@@ 14-31 (lines=18) @@ | ||
11 | ] |
|
12 | ||
13 | ||
14 | @pytest.mark.parametrize("command_name", ['arf-to-graph', 'arf-to-json']) |
|
15 | def test_command_with_bad_arf_file_with_verbose(command_name): |
|
16 | command = [ |
|
17 | 'python3', |
|
18 | '-m', |
|
19 | 'oval_graph.command_line', |
|
20 | command_name, |
|
21 | '-v', |
|
22 | 'tests/test_data/xccdf_org.ssgproject.content_profile_ospp-results-initial.xml', |
|
23 | '.' |
|
24 | ] |
|
25 | out = subprocess.check_output( |
|
26 | command, |
|
27 | stderr=subprocess.STDOUT) |
|
28 | out_string = out.decode('utf-8') |
|
29 | assert out_string.find("Traceback") > -1 |
|
30 | assert out_string.find("Warning:") > -1 |
|
31 | assert out_string.find("Error:") > -1 |
|
32 | ||
33 | ||
34 | @pytest.mark.parametrize("command_name", ['arf-to-graph', 'arf-to-json']) |
|
@@ 34-50 (lines=17) @@ | ||
31 | assert out_string.find("Error:") > -1 |
|
32 | ||
33 | ||
34 | @pytest.mark.parametrize("command_name", ['arf-to-graph', 'arf-to-json']) |
|
35 | def test_command_with_bad_arf_file(command_name): |
|
36 | command = [ |
|
37 | 'python3', |
|
38 | '-m', |
|
39 | 'oval_graph.command_line', |
|
40 | command_name, |
|
41 | 'tests/test_data/xccdf_org.ssgproject.content_profile_ospp-results-initial.xml', |
|
42 | '.' |
|
43 | ] |
|
44 | out = subprocess.check_output( |
|
45 | command, |
|
46 | stderr=subprocess.STDOUT) |
|
47 | out_string = out.decode('utf-8') |
|
48 | assert out_string.find("Traceback") == -1 |
|
49 | assert out_string.find("Warning:") > -1 |
|
50 | assert out_string.find("Error:") > -1 |
|
51 | ||
52 | ||
53 | def test_bad_command_json_to_graph_with_verbose(): |