From 2fd6aaa30d000113fc9a599d4cda254057ff6a91 Mon Sep 17 00:00:00 2001 From: vijaysawant Date: Tue, 10 Dec 2024 22:45:10 +0530 Subject: [PATCH 1/2] delete subscription manifest so it can re imported again --- tests/foreman/api/test_subscription.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/foreman/api/test_subscription.py b/tests/foreman/api/test_subscription.py index 9c484733132..05606b1cf9f 100644 --- a/tests/foreman/api/test_subscription.py +++ b/tests/foreman/api/test_subscription.py @@ -80,8 +80,13 @@ def test_positive_create(module_sca_manifest, module_target_sat): :CaseImportance: Critical """ - org = module_target_sat.api.Organization().create() - module_target_sat.upload_manifest(org.id, module_sca_manifest.content) + try: + org = module_target_sat.api.Organization().create() + module_target_sat.upload_manifest(org.id, module_sca_manifest.content) + finally: + module_target_sat.api.Subscription(organization=org).delete_manifest( + data={'organization_id': org.id} + ) @pytest.mark.tier1 From a7f6ed0dd7a01b5e65f1bb3d14b89897e47ac8ce Mon Sep 17 00:00:00 2001 From: vijaysawant Date: Wed, 11 Dec 2024 18:05:52 +0530 Subject: [PATCH 2/2] removing test case as discussed in review --- tests/foreman/api/test_subscription.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/tests/foreman/api/test_subscription.py b/tests/foreman/api/test_subscription.py index 05606b1cf9f..c112be5c9f6 100644 --- a/tests/foreman/api/test_subscription.py +++ b/tests/foreman/api/test_subscription.py @@ -69,26 +69,6 @@ def module_ak(module_sca_manifest_org, rh_repo, custom_repo, module_target_sat): ).create() -@pytest.mark.tier1 -@pytest.mark.pit_server -def test_positive_create(module_sca_manifest, module_target_sat): - """Upload a manifest. - - :id: 6faf9d96-9b45-4bdc-afa9-ec3fbae83d41 - - :expectedresults: Manifest is uploaded successfully - - :CaseImportance: Critical - """ - try: - org = module_target_sat.api.Organization().create() - module_target_sat.upload_manifest(org.id, module_sca_manifest.content) - finally: - module_target_sat.api.Subscription(organization=org).delete_manifest( - data={'organization_id': org.id} - ) - - @pytest.mark.tier1 def test_positive_refresh(function_sca_manifest_org, request, target_sat): """Upload a manifest and refresh it afterwards.