Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Merge requests
!1036
make productfectcher use default threads capo property
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
make productfectcher use default threads capo property
productfetcher_tweaks
into
main
Overview
0
Commits
4
Pipelines
4
Changes
1
Merged
Charlotte Hausman
requested to merge
productfetcher_tweaks
into
main
2 years ago
Overview
0
Commits
4
Pipelines
4
Changes
1
Expand
0
0
Merge request reports
Viewing commit
78e52d60
Prev
Next
Show latest version
1 file
+
23
−
21
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
78e52d60
fix test
· 78e52d60
Charlotte Hausman
authored
2 years ago
apps/cli/executables/pexable/productfetcher/tests/test_product_fetcher.py
+
23
−
21
Options
@@ -88,27 +88,29 @@ def test_multiple_locator_fetching(capsys, resource_path_root):
:param capsys:
:return:
"""
img
=
resource_path_root
/
"
location_files
"
/
"
IMG.json
"
cal
=
resource_path_root
/
"
location_files
"
/
"
CALIBRATION.json
"
# parse the command line with these two
fc
=
FetchContext
.
parse_commandline
([
CLIParam
.
FILE
.
value
,
str
(
img
),
CLIParam
.
FILE
.
value
,
str
(
cal
)])
assert
len
(
fc
.
locators
)
==
2
# let's make the plan and ensure we have all the stuff we expect from both
plan
=
fc
.
generate_plan
()
# we'll need to open these files ourselves to figure out what fetchers we expect
for
locator_file
in
[
img
,
cal
]:
for
file
in
FileLocator
(
locator_file
).
locate
().
files
:
seen
=
False
# there may be a more "test friendly" way of doing this, such as by asking the plan
# if it is fetching a certain file, but it seems like a lot of refactoring for this
# one test, so I'm going to leave it alone for now
for
hostgroup_fetcher
in
plan
.
fetchers
:
seen
=
seen
or
file
in
[
fetcher
.
file
for
fetcher
in
hostgroup_fetcher
.
fetchers
]
assert
seen
with
patch
(
"
productfetcher.product_fetcher.CapoConfig
"
)
as
mocked_capo
:
mocked_capo
.
return_value
.
settings
.
return_value
.
defaultThreadsPerHost
=
1
img
=
resource_path_root
/
"
location_files
"
/
"
IMG.json
"
cal
=
resource_path_root
/
"
location_files
"
/
"
CALIBRATION.json
"
# parse the command line with these two
fc
=
FetchContext
.
parse_commandline
([
CLIParam
.
FILE
.
value
,
str
(
img
),
CLIParam
.
FILE
.
value
,
str
(
cal
)])
assert
len
(
fc
.
locators
)
==
2
# let's make the plan and ensure we have all the stuff we expect from both
plan
=
fc
.
generate_plan
()
# we'll need to open these files ourselves to figure out what fetchers we expect
for
locator_file
in
[
img
,
cal
]:
for
file
in
FileLocator
(
locator_file
).
locate
().
files
:
seen
=
False
# there may be a more "test friendly" way of doing this, such as by asking the plan
# if it is fetching a certain file, but it seems like a lot of refactoring for this
# one test, so I'm going to leave it alone for now
for
hostgroup_fetcher
in
plan
.
fetchers
:
seen
=
seen
or
file
in
[
fetcher
.
file
for
fetcher
in
hostgroup_fetcher
.
fetchers
]
assert
seen
def
test_argument_parsing
(
capsys
):
Loading