MCPcopy Index your code
hub / github.com/aboutcode-org/vulnerablecode / getTests

Method getTests

vulnerabilities/lib_oval.py:334–355  ·  view source on GitHub ↗

Returns a list of all tests in this OvalDocument where each list item is of type OvalTest Returns None if no tests could be found @rtype: List @return: All tests in the OVAL document or None if none were found

(self)

Source from the content-addressed store, hash-verified

332 return [OvalDefinition(element) for element in element_list]
333
334 def getTests(self):
335 """
336 Returns a list of all tests in this OvalDocument where each list item is of type OvalTest
337 Returns None if no tests could be found
338
339 @rtype: List
340 @return: All tests in the OVAL document or None if none were found
341 """
342 root = self.getDocumentRoot()
343 if not root:
344 return None
345
346 testroot = root.find("def:tests", OvalDocument.NS_DEFAULT)
347
348 if testroot is None:
349 return None
350
351 element_list = list(testroot)
352 if not element_list:
353 return None
354
355 return [OvalTest(element) for element in element_list]
356
357 def getObjects(self):
358 """

Callers 5

__init__Method · 0.95
__init__Method · 0.80
test_ovaltest_sortingFunction · 0.80

Calls 2

getDocumentRootMethod · 0.95
OvalTestClass · 0.85

Tested by 3

test_ovaltest_sortingFunction · 0.64