Skip to content

Commit 50572a1

Browse files
committed
flake8
Signed-off-by: hkkim <[email protected]>
1 parent ac1ff10 commit 50572a1

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

tests/test_tox.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
import os
22
import subprocess
3-
import pytest
3+
44

55
def run_command(command):
6-
process=subprocess.run(command, shell=True, capture_output=True, text=True)
7-
success= (process.returncode ==0)
6+
process = subprocess.run(command, shell=True, capture_output=True, text=True)
7+
success = (process.returncode == 0)
88
return success, process.stdout if success else process.stderr
99

1010
def test_run():
1111
run_command("rm -rf test_scan test_scan2 test_scan3")
1212
os.makedirs("test_scan")
13-
scan_success,_ = run_command("fosslight_source -p tests/test_files -j -m -o test_scan")
14-
scan_exclude_success,_=run_command("fosslight_source -p tests -e test_files/test cli_test.py -j -m -o test_scan2")
13+
scan_success, _ = run_command("fosslight_source -p tests/test_files -j -m -o test_scan")
14+
scan_exclude_success, _ = run_command("fosslight_source -p tests -e test_files/test cli_test.py -j -m -o test_scan2")
1515

16-
scan_files=os.listdir("test_scan")
17-
scan2_files=os.listdir('test_scan2')
16+
scan_files = os.listdir("test_scan")
17+
scan2_files = os.listdir('test_scan2')
1818

19-
#then
2019
assert scan_success is True, "Test Run: Scan command failed"
2120
assert scan_exclude_success is True, "Test Run: Exclude command failed"
2221

23-
assert len(scan_files)>0, "Test Run: No scan files created in test_scan directory"
24-
assert len(scan2_files)>0, "Test Run: No scan files created in test_scan2 directory"
22+
assert len(scan_files) > 0, "Test Run: No scan files created in test_scan directory"
23+
assert len(scan2_files) > 0, "Test Run: No scan files created in test_scan2 directory"
2524

2625
def test_help_command():
2726
success, _ = run_command("fosslight_source -h")
2827
assert success is True, "Test Release: Help command failed "
2928

3029
def test_scan_command():
31-
success,_= run_command("fosslight_source -p tests/test_files -o test_scan/scan_result.csv")
30+
success, _ = run_command("fosslight_source -p tests/test_files -o test_scan/scan_result.csv")
3231
assert success is True, "Test Release: Failed to generate scan result CSV file"
3332

3433
assert os.path.exists("test_scan/scan_result.csv"), "Test Release: scan_result.csv file not generated"
@@ -40,7 +39,7 @@ def test_scan_command():
4039
print(f"Content of scan_result.csv:\n{content}")
4140

4241
def test_exclude_command():
43-
success,_= run_command("fosslight_source -p tests -e test_files/test cli_test.py -j -m -o test_scan2/scan_exclude_result.csv")
42+
success, _ = run_command("fosslight_source -p tests -e test_files/test cli_test.py -j -m -o test_scan2/scan_exclude_result.csv")
4443
assert success is True, "Test release: Exclude scan failded"
4544

4645
assert os.path.exists("test_scan2/scan_exclude_result.csv"), "Test Release: scan_exclude_result.csv file not generated"
@@ -52,7 +51,7 @@ def test_exclude_command():
5251
print(f"Content of scan_exclude_result.csv:\n{content}")
5352

5453
def test_json_command():
55-
success,_=run_command("fosslight_source -p tests/test_files -m -j -o test_scan3/")
54+
success, _ = run_command("fosslight_source -p tests/test_files -m -j -o test_scan3/")
5655
assert success is True, "Test release: Failed to generate JSON files"
5756

5857
def test_ls_test_scan3_command():
@@ -61,6 +60,6 @@ def test_ls_test_scan3_command():
6160
print(f"Files in test_scan3: {files_in_test_scan3}")
6261

6362
def test_flake8():
64-
success,_ =run_command("flake8")
63+
success, _ = run_command("flake8")
6564
assert success is True, "Flake8: Style check failed"
6665

0 commit comments

Comments
 (0)