def test_get_dict(): detection = Detection(examples_path, '.') extension = ['php', 'js', 'java'] type_num = {} type_num = detection.get_dict(extension, type_num) print(type(type_num)) assert type_num['php']['blank'] == 0
def test_param_xml(): detection = Detection(examples_path, '.') frame_data = {} language_data = {} tree = detection.rule() root = tree.getroot() frame_data, language_data = detection.parse_xml(root, frame_data, language_data) assert 'WordPress' in frame_data assert 'php' in language_data
def test_rule(): detection = Detection(examples_path, '.') root = eT.ElementTree(file=examples_path + '/param_xml.xml') tree = detection.rule() assert type(root) is type(tree)
def test_framework(): detection = Detection(vul_path + 'requirements.txt', '.') frame = detection.framework assert frame == 'Flask'
def test_cloc(): assert Detection(examples_path, '.').cloc()
def test_get_dict(): detection = Detection(examples_path, '.') extension = ['php', 'js', 'java'] type_num = {} type_num = detection.get_dict(extension, type_num) assert isinstance(extension, type(type_num.keys()))