Beispiel #1
0
 def test_get_identifiers_for_paths(self):
     args = build_parser([PROJECT_DIR, SPDX_FILE_NAME])
     deps = get_dependencies(args)
     deps_l = get_dependencies_file_paths(deps)
     glob_to_skip = []
     all_identifiers = get_identifiers_for_paths(deps_l, glob_to_skip)
     assert IDENTIFIER_EX1 in all_identifiers
     assert IDENTIFIER_EX2 in all_identifiers
Beispiel #2
0
 def test_create_spdx_document(self):
     args = build_parser([PROJECT_DIR, SPDX_FILE_NAME, "--tv"])
     create_spdx_document(args)
     file_path = os.path.join(PROJECT_DIR,
                              SPDX_FILE_NAME + FILE_SUFFIX + ".spdx")
     assert os.path.exists(file_path) == True
     os.remove(file_path)
     assert os.path.exists(file_path) == False
Beispiel #3
0
 def test_deps_file_paths(self):
     args = build_parser([PROJECT_DIR, SPDX_FILE_NAME])
     deps = get_dependencies(args)
     deps_l = get_dependencies_file_paths(deps)
     assert os.path.join(PROJECT_DIR, FILE_NAME1_IN_PROJECT) in deps_l
     assert os.path.join(PROJECT_DIR, FILE_NAME2_IN_PROJECT) in deps_l
Beispiel #4
0
 def test_get_dependencies(self):
     args = build_parser([PROJECT_DIR, SPDX_FILE_NAME])
     deps = get_dependencies(args)
     assert PROJECT_DIR in deps
Beispiel #5
0
 def test_parser_res_arg(self):
     args = build_parser(
         [PROJECT_DIR, SPDX_FILE_NAME, "--tv", "--rdf", "--res"])
     assert args.res == True
Beispiel #6
0
 def test_parser_tagvalue_arg(self):
     args = build_parser([PROJECT_DIR, SPDX_FILE_NAME, "--tv"])
     assert args.tv == True
     assert False == args.rdf == False
     assert False == args.res == False
Beispiel #7
0
 def test_parser_file_name(self):
     args = build_parser([PROJECT_DIR, SPDX_FILE_NAME])
     assert args.spdx_file_name == SPDX_FILE_NAME
     assert False == args.tv == False
     assert False == args.rdf == False
     assert False == args.res == False
Beispiel #8
0
 def test_parser_project_path(self):
     args = build_parser([PROJECT_DIR, SPDX_FILE_NAME])
     assert PROJECT_DIR == args.project_path
     assert False == args.tv == False
     assert False == args.rdf == False
     assert False == args.res == False