@@ -18,36 +18,50 @@ def test_run():
1818 assert scan_exclude_success is True , "Test Run: Exclude command failed"
1919
2020
21- def test_release ():
21+ def test_help_command ():
2222 success , _ = run_command ("fosslight_source -h" )
2323 assert success is True , "Test Release: Help command failed "
2424
25+
26+ def test_scan_command ():
2527 success , _ = run_command ("fosslight_source -p tests/test_files -o test_scan/scan_result.csv" )
2628 assert success is True , "Test Release: Failed to generate scan result CSV file"
29+
2730 assert os .path .exists ("test_scan/scan_result.csv" ), "Test Release: scan_result.csv file not generated"
31+
2832 with open ("test_scan/scan_result.csv" , 'r' ) as file :
2933 content = file .read ()
34+
3035 assert len (content ) > 0 , "Test Release: scan_result.csv is empty"
3136 print (f"Content of scan_result.csv:\n { content } " )
3237
38+
39+ def test_exclude_command ():
3340 success , _ = run_command (
3441 "fosslight_source -p tests -e test_files/test cli_test.py -j -m -o test_scan2/scan_exclude_result.csv"
3542 )
3643 assert success is True , "Test release: Exclude scan failded"
44+
3745 assert os .path .exists ("test_scan2/scan_exclude_result.csv" ), "Test Release: scan_exclude_result.csv file not generated"
46+
3847 with open ("test_scan2/scan_exclude_result.csv" , 'r' ) as file :
3948 content = file .read ()
49+
4050 assert len (content ) > 0 , "Test Release: scan_exclude_result.csv is empty"
4151 print (f"Content of scan_exclude_result.csv:\n { content } " )
4252
53+
54+ def test_json_command ():
4355 success , _ = run_command ("fosslight_source -p tests/test_files -m -j -o test_scan3/" )
4456 assert success is True , "Test release: Failed to generate JSON files"
4557
58+
59+ def test_ls_test_scan3_command ():
4660 files_in_test_scan3 = os .listdir ("test_scan3" )
4761 assert len (files_in_test_scan3 ) > 0 , "Test Release: test_scan3 is empty"
4862 print (f"Files in test_scan3: { files_in_test_scan3 } " )
4963
5064
5165def test_flake8 ():
52- success , _ = run_command ("flake8" )
66+ success , _ = run_command ("flake8 -j 4 " )
5367 assert success is True , "Flake8: Style check failed"
0 commit comments