From 8a9bbc611476e9944e13c1db5de43711f1de72cb Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Thu, 11 Jan 2024 11:22:40 +0100 Subject: [PATCH 1/2] Fixes in cli_factory - remove @lru_cache from CLIFactory.__getattr__ - flip output format of cli.Repository.synchronize to from 'csv' to 'base' (output is not in csv format here) --- robottelo/cli/repository.py | 2 +- robottelo/host_helpers/cli_factory.py | 1 - tests/foreman/cli/test_capsulecontent.py | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/robottelo/cli/repository.py b/robottelo/cli/repository.py index 85296f25e51..94fa8baa180 100644 --- a/robottelo/cli/repository.py +++ b/robottelo/cli/repository.py @@ -60,7 +60,7 @@ def synchronize(cls, options, return_raw_response=None, timeout=3600000): cls.command_sub = 'synchronize' return cls.execute( cls._construct_command(options), - output_format='csv', + output_format='base', ignore_stderr=True, return_raw_response=return_raw_response, timeout=timeout, diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index efb5a8fb4b8..fdfd29152ab 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -249,7 +249,6 @@ def __init__(self, satellite): self._satellite = satellite self.__dict__.update(initiate_repo_helpers(self._satellite)) - @lru_cache def __getattr__(self, name): """We intercept the usual attribute behavior on this class to emulate make_entity methods The keys in the dictionary above correspond to potential make_ methods diff --git a/tests/foreman/cli/test_capsulecontent.py b/tests/foreman/cli/test_capsulecontent.py index b55b845719b..63e2096b6ef 100644 --- a/tests/foreman/cli/test_capsulecontent.py +++ b/tests/foreman/cli/test_capsulecontent.py @@ -201,3 +201,19 @@ def test_positive_update_counts(target_sat, module_capsule_configured): search_rate=5, max_tries=5, ) + + +@pytest.mark.parametrize( + 'repos_collection', + [ + { + 'distro': 'rhel8', + 'YumRepository': {'url': settings.repos.module_stream_1.url}, + 'FileRepository': {'url': CUSTOM_FILE_REPO}, + } + ], + indirect=True, +) +def test_dummie(repos_collection, function_org, function_lce): + repos_collection.setup_content(function_org.id, function_lce.id, upload_manifest=False) + pass From 09548858ce6729010515ff67da760685f0dba861 Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Thu, 11 Jan 2024 15:35:07 +0100 Subject: [PATCH 2/2] Remmove the test_dummie --- tests/foreman/cli/test_capsulecontent.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/foreman/cli/test_capsulecontent.py b/tests/foreman/cli/test_capsulecontent.py index 63e2096b6ef..b55b845719b 100644 --- a/tests/foreman/cli/test_capsulecontent.py +++ b/tests/foreman/cli/test_capsulecontent.py @@ -201,19 +201,3 @@ def test_positive_update_counts(target_sat, module_capsule_configured): search_rate=5, max_tries=5, ) - - -@pytest.mark.parametrize( - 'repos_collection', - [ - { - 'distro': 'rhel8', - 'YumRepository': {'url': settings.repos.module_stream_1.url}, - 'FileRepository': {'url': CUSTOM_FILE_REPO}, - } - ], - indirect=True, -) -def test_dummie(repos_collection, function_org, function_lce): - repos_collection.setup_content(function_org.id, function_lce.id, upload_manifest=False) - pass