Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions vulnerabilities/importers/suse_oval.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions vulnerabilities/tests/test_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA = os.path.join(BASE_DIR, "test_data/")
TEST_DATA_01 = os.path.join(BASE_DIR, "test_data/suse_oval")


def load_oval_data():
Expand Down Expand Up @@ -136,28 +135,3 @@ def test_git_importer_clone(git_importer):
list(git_importer().advisory_data())
mock_fetch.assert_called_once()
mock_delete.assert_called_once()


# Here we use a modified copy of org.opensuse.CVE-2008-5679.xml -- the test versions are modified to illustrate sort order.
def test_ovaltest_sorting():
xml_doc = ET.parse(
os.path.join(TEST_DATA_01, "org.opensuse.CVE-2008-5679-modified-versions.xml")
)
translations = {"less than": "<", "equals": "=", "greater than or equal": ">="}
parsed_oval = OvalParser(translations, xml_doc)

# Get the list of all tests and check the total number of tests.
get_all_tests = parsed_oval.oval_document.getTests()

# Check the order of the four tests in the sorted `get_all_tests` list. (Testing suggests that the
# original list of tests, `get_all_tests`, is unsorted and is ordered in the same order as the test
# elements appear in the .xml file.)
sorted_tests = sorted(get_all_tests)
test_results = [(test.getId(), test.getVersion()) for test in sorted_tests]
expected = [
("oval:org.opensuse.security:tst:2009030401", "1"),
("oval:org.opensuse.security:tst:2009030403", "4"),
("oval:org.opensuse.security:tst:2009030402", "9"),
("oval:org.opensuse.security:tst:2009030400", "11"),
]
assert test_results == expected
Loading
Loading