|
30 | 30 |
|
31 | 31 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) |
32 | 32 | TEST_DATA = os.path.join(BASE_DIR, "test_data/") |
33 | | -TEST_DATA_01 = os.path.join(BASE_DIR, "test_data/suse_oval") |
34 | 33 |
|
35 | 34 |
|
36 | 35 | def load_oval_data(): |
@@ -136,28 +135,3 @@ def test_git_importer_clone(git_importer): |
136 | 135 | list(git_importer().advisory_data()) |
137 | 136 | mock_fetch.assert_called_once() |
138 | 137 | mock_delete.assert_called_once() |
139 | | - |
140 | | - |
141 | | -# Here we use a modified copy of org.opensuse.CVE-2008-5679.xml -- the test versions are modified to illustrate sort order. |
142 | | -def test_ovaltest_sorting(): |
143 | | - xml_doc = ET.parse( |
144 | | - os.path.join(TEST_DATA_01, "org.opensuse.CVE-2008-5679-modified-versions.xml") |
145 | | - ) |
146 | | - translations = {"less than": "<", "equals": "=", "greater than or equal": ">="} |
147 | | - parsed_oval = OvalParser(translations, xml_doc) |
148 | | - |
149 | | - # Get the list of all tests and check the total number of tests. |
150 | | - get_all_tests = parsed_oval.oval_document.getTests() |
151 | | - |
152 | | - # Check the order of the four tests in the sorted `get_all_tests` list. (Testing suggests that the |
153 | | - # original list of tests, `get_all_tests`, is unsorted and is ordered in the same order as the test |
154 | | - # elements appear in the .xml file.) |
155 | | - sorted_tests = sorted(get_all_tests) |
156 | | - test_results = [(test.getId(), test.getVersion()) for test in sorted_tests] |
157 | | - expected = [ |
158 | | - ("oval:org.opensuse.security:tst:2009030401", "1"), |
159 | | - ("oval:org.opensuse.security:tst:2009030403", "4"), |
160 | | - ("oval:org.opensuse.security:tst:2009030402", "9"), |
161 | | - ("oval:org.opensuse.security:tst:2009030400", "11"), |
162 | | - ] |
163 | | - assert test_results == expected |
0 commit comments