@@ -7,6 +7,7 @@ def run_command(command):
77 success = (process .returncode == 0 )
88 return success , process .stdout if success else process .stderr
99
10+
1011def test_run ():
1112 run_command ("rm -rf test_scan test_scan2 test_scan3" )
1213 os .makedirs ("test_scan" )
@@ -22,10 +23,12 @@ def test_run():
2223 assert len (scan_files ) > 0 , "Test Run: No scan files created in test_scan directory"
2324 assert len (scan2_files ) > 0 , "Test Run: No scan files created in test_scan2 directory"
2425
26+
2527def test_help_command ():
2628 success , _ = run_command ("fosslight_source -h" )
2729 assert success is True , "Test Release: Help command failed "
2830
31+
2932def test_scan_command ():
3033 success , _ = run_command ("fosslight_source -p tests/test_files -o test_scan/scan_result.csv" )
3134 assert success is True , "Test Release: Failed to generate scan result CSV file"
@@ -38,8 +41,10 @@ def test_scan_command():
3841 assert len (content ) > 0 , "Test Release: scan_result.csv is empty"
3942 print (f"Content of scan_result.csv:\n { content } " )
4043
44+
4145def test_exclude_command ():
42- success , _ = run_command ("fosslight_source -p tests -e test_files/test cli_test.py -j -m -o test_scan2/scan_exclude_result.csv" )
46+ success , _ = run_command ("fosslight_source -p tests -e test_files/test cli_test.py "
47+ "-j -m -o test_scan2/scan_exclude_result.csv" )
4348 assert success is True , "Test release: Exclude scan failded"
4449
4550 assert os .path .exists ("test_scan2/scan_exclude_result.csv" ), "Test Release: scan_exclude_result.csv file not generated"
@@ -50,16 +55,18 @@ def test_exclude_command():
5055 assert len (content ) > 0 , "Test Release: scan_exclude_result.csv is empty"
5156 print (f"Content of scan_exclude_result.csv:\n { content } " )
5257
58+
5359def test_json_command ():
54- success , _ = run_command ("fosslight_source -p tests/test_files -m -j -o test_scan3/" )
60+ success , _ = run_command ("fosslight_source -p tests/test_files -m -j -o test_scan3/" )
5561 assert success is True , "Test release: Failed to generate JSON files"
5662
63+
5764def test_ls_test_scan3_command ():
5865 files_in_test_scan3 = os .listdir ("test_scan3" )
5966 assert len (files_in_test_scan3 ) > 0 , "Test Release: test_scan3 is empty"
6067 print (f"Files in test_scan3: { files_in_test_scan3 } " )
6168
69+
6270def test_flake8 ():
6371 success , _ = run_command ("flake8" )
6472 assert success is True , "Flake8: Style check failed"
65-
0 commit comments