From 447f218f742a3b2751ae59e378d41a1ef288381d Mon Sep 17 00:00:00 2001 From: vsedmik <46570670+vsedmik@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:39:06 +0100 Subject: [PATCH] Fix host-collections tests (#13442) --- tests/foreman/cli/test_hostcollection.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/foreman/cli/test_hostcollection.py b/tests/foreman/cli/test_hostcollection.py index a7710f79fc6..91bf5c4f563 100644 --- a/tests/foreman/cli/test_hostcollection.py +++ b/tests/foreman/cli/test_hostcollection.py @@ -30,15 +30,13 @@ ) -def _make_fake_host_helper(module_org, module_target_sat): +def _make_fake_host_helper(module_org, sat): """Make a new fake host""" - library = module_target_sat.cli.LifecycleEnvironment.info( + library = sat.cli.LifecycleEnvironment.info( {'organization-id': module_org.id, 'name': ENVIRONMENT} ) - default_cv = module_target_sat.cli.ContentView.info( - {'organization-id': module_org.id, 'name': DEFAULT_CV} - ) - return module_target_sat.cli_factory.make_fake_host( + default_cv = sat.cli.ContentView.info({'organization-id': module_org.id, 'name': DEFAULT_CV}) + return sat.cli_factory.make_fake_host( { 'content-view-id': default_cv['id'], 'lifecycle-environment-id': library['id'], @@ -262,7 +260,7 @@ def test_positive_host_collection_host_pagination(module_org, module_target_sat) {'organization-id': module_org.id} ) host_ids = ','.join( - _make_fake_host_helper((module_org)['id'] for _ in range(2)), module_target_sat + _make_fake_host_helper(module_org, module_target_sat)['id'] for _ in range(2) ) module_target_sat.cli.HostCollection.add_host( {'host-ids': host_ids, 'id': host_collection['id']} @@ -316,7 +314,7 @@ def test_positive_register_host_ak_with_host_collection(module_org, module_ak_wi :CaseLevel: System """ - host_info = _make_fake_host_helper(module_org) + host_info = _make_fake_host_helper(module_org, target_sat) hc = target_sat.cli_factory.make_host_collection({'organization-id': module_org.id}) target_sat.cli.ActivationKey.add_host_collection(