|
2 | 2 | # -*- coding: utf-8 -*- |
3 | 3 | # Copyright (c) 2021 LG Electronics Inc. |
4 | 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | +import os.path |
5 | 6 |
|
6 | 7 | UBUNTU_COMMANDS = [ |
7 | 8 | "fosslight_dependency -p tests/test_pub -o tests/result/pub", |
8 | 9 | "fosslight_dependency -p tests/test_exclude -e requirements.txt -o tests/result/exclude" |
9 | 10 | ] |
10 | 11 |
|
| 12 | +DIST_PATH = os.path.join(os.path.abspath(os.sep), "dist", "cli.exe") |
| 13 | +INPUT_PATH = os.path.join("tests", "test_pub") |
| 14 | +OUTPUT_PATH = os.path.join("tests", "result", "pub") |
| 15 | +INPUT_PATH2 = os.path.join("tests", "test_exclude") |
| 16 | +OUTPUT_PATH2 = os.path.join("tests", "result", "exclude") |
| 17 | + |
| 18 | +WINDOW_COMMANDS = [ |
| 19 | + f"{DIST_PATH} -p {INPUT_PATH} -o {OUTPUT_PATH}", |
| 20 | + f"{DIST_PATH} -p {INPUT_PATH} -o {OUTPUT_PATH} -f opossum", |
| 21 | + f"{DIST_PATH} -p {INPUT_PATH} -e requirements.txt -o {OUTPUT_PATH}" |
| 22 | +] |
| 23 | + |
11 | 24 |
|
12 | 25 | def test_ubuntu(run_command): |
13 | 26 | for command in UBUNTU_COMMANDS: |
14 | 27 | return_code, stdout, stderr = run_command(command) |
15 | 28 | assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}" |
| 29 | + |
| 30 | + |
| 31 | +def test_windows(run_command): |
| 32 | + for command in WINDOW_COMMANDS: |
| 33 | + return_code, stdout, stderr = run_command(command) |
| 34 | + assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}" |
0 commit comments