예제 #1
0
def test_rule_info():
    test_info = {}
    cve = CveParse(rule_path, target_directory)
    tree = cve.parse_xml(rule_cve_path)
    root = tree.getroot()
    cves = root.findall('.//cve')
    for cvea in cves:
        test_info = cve.rule_info(cvea)
    assert 'cpe' in test_info
예제 #2
0
def test_cve_info():
    test_info = {}
    cve = CveParse(rule_path, target_directory)
    tree = cve.parse_xml(cve.cve_file)
    root = tree.getroot()
    childs = root.findall('.//%sentry' % cve.NS)
    for child in childs:  # child is entry Element
        test_info = cve.cve_info(child)
    assert isinstance(test_info, dict)
예제 #3
0
def test_rule_info():
    test_info = {}
    cve = CveParse(rule_path, target_directory)
    tree = cve.parse_xml(rule_cve_path)
    root = tree.getroot()
    cves = root.findall('.//cve')
    for cvea in cves:
        test_info = cve.rule_info(cvea)
    assert 'cpe' in test_info
예제 #4
0
def test_cve_info():
    test_info = {}
    cve = CveParse(rule_path, target_directory)
    tree = cve.parse_xml(cve.cve_file)
    root = tree.getroot()
    childs = root.findall('.//%sentry' % cve.NS)
    for child in childs:  # child is entry Element
        test_info = cve.cve_info(child)
    assert isinstance(test_info, dict)
예제 #5
0
def test_parse_xml():
    cve = CveParse(rule_path, target_directory)
    tree = cve.parse_xml(cve.cve_file)
    root = eT.parse(rule_path)
    assert isinstance(tree, type(root))
예제 #6
0
def test_parse_xml():
    cve = CveParse(rule_path, target_directory)
    tree = cve.parse_xml(cve.cve_file)
    root = eT.parse(rule_path)
    assert isinstance(tree, type(root))