Skip to content

Commit 332b0fe

Browse files
committed
final
Signed-off-by: hkkim <[email protected]>
1 parent a3ea09e commit 332b0fe

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

tests/test_tox.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

5165
def test_flake8():
52-
success, _ = run_command("flake8")
66+
success, _ = run_command("flake8 -j 4")
5367
assert success is True, "Flake8: Style check failed"

tox.ini

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,22 @@ deps =
2626
-r{toxinidir}/requirements-dev.txt
2727

2828
commands =
29-
pytest tests/test_tox.py::test_run
29+
pytest tests/test_tox.py::test_run --maxfail=1 --disable-warnings --cache-clear
3030

3131
[testenv:release]
3232
deps =
3333
-r{toxinidir}/requirements-dev.txt
3434

3535
commands =
36-
pytest tests/test_tox.py::test_release
36+
pytest tests/test_tox.py::test_help_command tests/test_tox.py::test_scan_command \
37+
tests/test_tox.py::test_exclude_command tests/test_tox.py::test_json_command \
38+
tests/test_tox.py::test_ls_test_scan3_command \
39+
--maxfail=1 --disable-warnings
40+
3741
python tests/cli_test.py
3842
pytest -v --flake8
3943

4044
[testenv:flake8]
4145
deps = flake8
4246
commands =
43-
pytest tests/test_tox.py::test_flake8
47+
pytest tests/test_tox.py::test_flake8

0 commit comments

Comments
 (0)