Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 3, 2024
1 parent 0af1426 commit 2f283f1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
7 changes: 5 additions & 2 deletions pubtools/_pulp/tasks/push/phase/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ def run(self):
if item_type not in upload_context:
upload_context[item_type] = {}
if item.upload_repo not in upload_context[item_type]:
upload_context[item_type][item.upload_repo] = \
upload_context[item_type][item.upload_repo] = (
item.upload_context(self.pulp_client)
)
ctx = upload_context[item_type][item.upload_repo]
else:
if item_type not in upload_context:
upload_context[item_type] = item.upload_context(self.pulp_client)
upload_context[item_type] = item.upload_context(
self.pulp_client
)
ctx = upload_context[item_type]
uploading += 1
self.put_future_output(item.ensure_uploaded(ctx))
Expand Down
13 changes: 9 additions & 4 deletions tests/fake/test_fake_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ def test_state_persisted(tmpdir, data_path):
# It should already have a few repos since there is some default
# state.
repo_ids = sorted([repo.id for repo in client.search_repository()])
assert repo_ids == ["all-erratum-content-2019", "all-erratum-content-2020",
"all-iso-content", "all-rpm-content",
"all-rpm-content-54", "all-rpm-content-e8",
"redhat-maintenance"]
assert repo_ids == [
"all-erratum-content-2019",
"all-erratum-content-2020",
"all-iso-content",
"all-rpm-content",
"all-rpm-content-54",
"all-rpm-content-e8",
"redhat-maintenance",
]

# Now add a bit more state.
# We use modules here because that's one of the more complex types
Expand Down
6 changes: 4 additions & 2 deletions tests/push/test_push_prepush.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ def test_pre_push(
assert units

# RPMs are separated into different arc repos by checksum
expected_repo_mapping = {"test-srpm01": ["all-rpm-content-54"],
"walrus": ["all-rpm-content-e8"]}
expected_repo_mapping = {
"test-srpm01": ["all-rpm-content-54"],
"walrus": ["all-rpm-content-e8"],
}

for unit in units:
# The only type of content is RPMs, because that's all we support for
Expand Down

0 comments on commit 2f283f1

Please sign in to comment.