From 4972e6259cf29bcc434de13b20768a9e7f77f35c Mon Sep 17 00:00:00 2001 From: Lubos Mjachky Date: Wed, 17 Jan 2024 15:26:38 +0100 Subject: [PATCH] Make sure a distribution is deleted before a repo version [noissue] The workflow had to be adjusted because of the breaking change introduced in https://github.com/pulp/pulpcore/pull/4750. --- pulp_ostree/tests/functional/api/test_import.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pulp_ostree/tests/functional/api/test_import.py b/pulp_ostree/tests/functional/api/test_import.py index 8a9d199b..d1e7b78b 100644 --- a/pulp_ostree/tests/functional/api/test_import.py +++ b/pulp_ostree/tests/functional/api/test_import.py @@ -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 @@ -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) @@ -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)