def test_prepare_tree(): src = 'test_data/ssg-fedora-ds-arf.xml' rule = 'xccdf_org.ssgproject.content_rule_package_abrt_removed' client = get_client_tree(src, rule) rules = {'rules': [rule]} client.prepare_data(rules) result = load_tested_file('../oval_graph/tree_html_interpreter/data.js') referenc_result = load_tested_file( 'test_data/referenc_result_data_tree.js') assert result == referenc_result
def main(): client = oval_graph.client.client(sys.argv[1:]) rules = client.search_rules_id() if len(rules) > 1: answers = client.run_gui_and_return_answers() if answers is None: print( "You haven't got installed inquirer lib. " "Please copy id rule with you want use and put it in command") else: client.prepare_data(answers) else: client.prepare_data({'rules': [rules[0]['id_rule']]})
def try_expection_for_prepare_graph(src, rule, err): client = get_client(src, rule) rules = {'rules': [rule]} with pytest.raises(Exception, match=err): assert client.prepare_data(rules)