From dc0e9b6acb0c827dabfde3722da34cbb0cc7ebd9 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Mon, 22 Jan 2024 12:18:09 +0100 Subject: [PATCH] cli oscap fix name already taken --- tests/foreman/cli/test_oscap.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/foreman/cli/test_oscap.py b/tests/foreman/cli/test_oscap.py index ecbc50f06de..c198e5fa636 100644 --- a/tests/foreman/cli/test_oscap.py +++ b/tests/foreman/cli/test_oscap.py @@ -286,8 +286,9 @@ def test_positive_create_scap_content_with_valid_originalfile_name( :CaseImportance: Medium """ + title = gen_string('alpha') scap_content = module_target_sat.cli_factory.scapcontent( - {'original-filename': name, 'scap-file': settings.oscap.content_path} + {'original-filename': name, 'scap-file': settings.oscap.content_path, 'title': title} ) assert scap_content['original-filename'] == name @@ -406,8 +407,9 @@ def test_positive_delete_scap_content_with_id(self, module_target_sat): :CaseImportance: Medium """ + title = gen_string('alpha') scap_content = module_target_sat.cli_factory.scapcontent( - {'scap-file': settings.oscap.content_path} + {'scap-file': settings.oscap.content_path, 'title': title} ) module_target_sat.cli.Scapcontent.delete({'id': scap_content['id']}) with pytest.raises(CLIReturnCodeError): @@ -436,8 +438,9 @@ def test_positive_delete_scap_content_with_title(self, module_target_sat): :CaseImportance: Medium """ + title = gen_string('alpha') scap_content = module_target_sat.cli_factory.scapcontent( - {'scap-file': settings.oscap.content_path} + {'scap-file': settings.oscap.content_path, 'title': title} ) module_target_sat.cli.Scapcontent.delete({'title': scap_content['title']}) with pytest.raises(CLIReturnCodeError):