From f127539743b6174039e087fb9a21df09dffb02fe Mon Sep 17 00:00:00 2001 From: Sam Bible Date: Thu, 14 Mar 2024 16:40:00 -0500 Subject: [PATCH] fix cli method description, condense logic --- robottelo/cli/contentview.py | 2 +- tests/foreman/cli/test_contentview.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/robottelo/cli/contentview.py b/robottelo/cli/contentview.py index 157464ba804..5bd4810e853 100644 --- a/robottelo/cli/contentview.py +++ b/robottelo/cli/contentview.py @@ -211,6 +211,6 @@ def component_list(cls, options=None): @classmethod def list(cls, options=None): - """List components attached to the content view""" + """List information about content views""" cls.command_sub = 'list' return cls.execute(cls._construct_command(options), output_format='csv') diff --git a/tests/foreman/cli/test_contentview.py b/tests/foreman/cli/test_contentview.py index 137730fd95e..56920e0d839 100644 --- a/tests/foreman/cli/test_contentview.py +++ b/tests/foreman/cli/test_contentview.py @@ -4085,7 +4085,7 @@ def test_show_all_repo_ids(self, module_org, module_product, module_target_sat): # Create 30 repositories repolist = [] id_list = [] - for _i in range(30): + for _ in range(30): repo = module_target_sat.api.Repository( product=module_product, checksum_type='sha256', @@ -4094,7 +4094,6 @@ def test_show_all_repo_ids(self, module_org, module_product, module_target_sat): ).create() repolist.append(repo) id_list.append(str(repo.id)) - id_list = ', '.join(id_list) # Sync and publish all repos cv = module_target_sat.api.ContentView( organization=module_org, repository=repolist @@ -4104,7 +4103,7 @@ def test_show_all_repo_ids(self, module_org, module_product, module_target_sat): cv.publish() # Run content-view list --name cv.name list_info = module_target_sat.cli.ContentView.list({'name': cv.name}) - assert (list_info[0]['repository-ids']) == id_list + assert (list_info[0]['repository-ids']) == ', '.join(id_list) class TestContentViewFileRepo: