Skip to content

Commit

Permalink
Make sure a distribution is deleted before a repo version
Browse files Browse the repository at this point in the history
[noissue]

The workflow had to be adjusted because of the breaking change
introduced in pulp/pulpcore#4750.
  • Loading branch information
lubosmj committed Jan 17, 2024
1 parent 329887b commit 4972e62
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pulp_ostree/tests/functional/api/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ def single_ref_import(self, number_of_commits):
distribution_data = OstreeOstreeDistribution(**gen_distribution(repository=repo.pulp_href))
response = self.distributions_api.create(distribution_data)
distribution = monitor_task(response.task).created_resources[0]
self.addCleanup(self.distributions_api.delete, distribution)

ostree_repo_path = self.distributions_api.read(distribution).base_url

Expand All @@ -280,6 +279,8 @@ def single_ref_import(self, number_of_commits):
)
self.assertEqual(response.status_code, 200)

monitor_task(self.distributions_api.delete(distribution).task)

def test_version_removal(self):
"""Test the repository version removal functionality by removing two adjacent versions."""
self.single_ref_import(1)
Expand All @@ -292,7 +293,7 @@ def test_version_removal(self):
monitor_task(response.task)
with self.assertRaises(requests.HTTPError) as exc:
self.client.get(repo_version1_href)
self.assertEqual(exc.exception.response.status_code, 404, repo_version2_href)
self.assertEqual(exc.exception.response.status_code, 404, repo_version1_href)

response = self.versions_api.delete(repo_version2_href)
monitor_task(response.task)
Expand Down

0 comments on commit 4972e62

Please sign in to comment.