Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #329/4972e625 backport][2.2] Make sure a distribution is deleted before a repo version #330

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading