Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hyagi committed Aug 8, 2024
1 parent c03b7a7 commit d24e890
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pulp_file/tests/functional/api/test_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_artifact_upload(
assert dup_artifact.sha256 == second_artifact.sha256

# Delete the artifacts so domain can be deleted
body = {"orphan_protection_time": 0, "content_hrefs": second_artifact_href}
body = {"orphan_protection_time": 0, "content_hrefs": [second_artifact_href]}
task = pulpcore_bindings.OrphansCleanupApi.cleanup(body, pulp_domain=domain.name).task
monitor_task(task)

Expand Down
2 changes: 1 addition & 1 deletion pulpcore/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ def _add_to_cleanup(api_client, pulp_href):
# Also we can never be sure which one is the right ApiException to catch.
if isinstance(api_client, ArtifactsApi):
task_url = pulpcore_bindings.OrphansCleanupApi.cleanup(
{"orphan_protection_time": 0, "content_hrefs": pulp_href}
{"orphan_protection_time": 0, "content_hrefs": [pulp_href]}
).task
else:
task_url = api_client.delete(pulp_href).task
Expand Down
4 changes: 2 additions & 2 deletions pulpcore/tests/functional/api/test_crd_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _upload_valid_attrs(artifact_api, file, data):
for key, val in artifact.to_dict().items():
assert getattr(read_artifact, key) == val
# Delete the Artifact
body = {"orphan_protection_time": 0, "content_hrefs": read_artifact.pulp_href}
body = {"orphan_protection_time": 0, "content_hrefs": [read_artifact.pulp_href]}
monitor_task(pulpcore_bindings.OrphansCleanupApi.cleanup(body).task)
with pytest.raises(ApiException) as e:
artifact_api.read(read_artifact.pulp_href)
Expand Down Expand Up @@ -171,7 +171,7 @@ def test_delete_artifact(pulpcore_bindings, pulpcore_random_file, gen_user, moni
assert e.value.status == 403

# remove artifact through orphan cleanup
body = {"orphan_protection_time": 0, "content_hrefs": artifact.pulp_href}
body = {"orphan_protection_time": 0, "content_hrefs": [artifact.pulp_href]}
monitor_task(pulpcore_bindings.OrphansCleanupApi.cleanup(body).task)
file_exists = os.path.exists(path_to_file)
assert not file_exists
Expand Down

0 comments on commit d24e890

Please sign in to comment.