Skip to content

Commit

Permalink
Add assertion to verify tested data is not pre-existing
Browse files Browse the repository at this point in the history
Issue: AAH-906
  • Loading branch information
bmclaughlin committed Oct 21, 2021
1 parent eb0a1a6 commit 7144a5e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from urllib.parse import urlparse

from pulpcore.client.galaxy_ng.exceptions import ApiException
from pulp_container.tests.functional.api import rbac_base
from pulp_container.tests.functional.constants import DOCKERHUB_PULP_FIXTURE_1
from pulp_smash import cli
Expand Down Expand Up @@ -43,6 +44,13 @@ def test_list_container_repository_tags(self):
image_path = f"{DOCKERHUB_PULP_FIXTURE_1}:manifest_a"
local_url = "/".join([self.registry_name, f"{image_name}:1.0"])

# expect the Container Repository Tags not to exist yet
with self.assertRaises(ApiException) as context:
self.container_repo_tags_api.list(base_path=image_name)

# Bad request
assert context.exception.status == 404

self._push(image_path, local_url, self.user_admin)

response = self.container_repo_tags_api.list(base_path=image_name)
Expand Down

0 comments on commit 7144a5e

Please sign in to comment.