From f24d745407bad7fc0d658a47ed4ed6ff5ada4958 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Thu, 27 Jun 2024 15:09:17 -0500 Subject: [PATCH] Convert test_platform_from_text_complex_expression to use features of the expression --- tests/unit/ssg-module/test_build_yaml.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit/ssg-module/test_build_yaml.py b/tests/unit/ssg-module/test_build_yaml.py index 92bafc581f32..41634f0abfc0 100644 --- a/tests/unit/ssg-module/test_build_yaml.py +++ b/tests/unit/ssg-module/test_build_yaml.py @@ -335,8 +335,7 @@ def test_platform_from_text_and_empty_conditionals(product_cpes): def test_platform_from_text_complex_expression(product_cpes): platform = ssg.build_yaml.Platform.from_text( "systemd and !yum and (ntp or chrony)", product_cpes) - assert platform.get_remediation_conditional("bash") == "( rpm --quiet -q systemd && ( rpm --quiet -q chrony || rpm --quiet -q ntp ) && ! ( rpm --quiet -q yum ) )" - assert platform.get_remediation_conditional("ansible") == "( \"systemd\" in ansible_facts.packages and ( \"chrony\" in ansible_facts.packages or \"ntp\" in ansible_facts.packages ) and not ( \"yum\" in ansible_facts.packages ) )" + assert platform.test(**{'systemd': True, 'ntp': False, 'chrony': True, 'yum': False}) platform_el = platform.to_xml_element() assert platform_el.tag == "{%s}platform" % cpe_language_namespace assert platform_el.get("id") == "systemd_and_chrony_or_ntp_and_not_yum"