Skip to content

Commit aeadbbc

Browse files
committed
refactor test codes
- rename test methods - separate window, ubuntu test codes Signed-off-by: yongjunhong <[email protected]>
1 parent d4479e5 commit aeadbbc

File tree

12 files changed

+44
-54
lines changed

12 files changed

+44
-54
lines changed

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
flake8==3.9.2
2-
pyinstaller
2+
pyinstaller>=6.10.0
33
tox>=4.18.1
44
pytest
55
pytest-cov

tests/pytest/package_manager/test_android.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_android -o tests/result/android -m android"
88
]
99

10+
WINDOW_COMMANDS = [
11+
"\dist\cli.exe -p tests\test_maven2 -o tests\result\maven2 -m maven"
12+
]
13+
14+
15+
def test_ubuntu(run_command):
16+
for command in UBUNTU_COMMANDS:
17+
return_code, stdout, stderr = run_command(command)
18+
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"
19+
1020

11-
def test_android_get_dependency(run_command):
12-
for command in COMMANDS:
21+
def test_window(run_command):
22+
for command in WINDOW_COMMANDS:
1323
return_code, stdout, stderr = run_command(command)
1424
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

tests/pytest/package_manager/test_carthage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_carthage -o tests/result/carthage -m carthage"
88
]
99

1010

11-
def test_carthage_get_dependency(run_command):
12-
for command in COMMANDS:
11+
def test_ubuntu(run_command):
12+
for command in UBUNTU_COMMANDS:
1313
return_code, stdout, stderr = run_command(command)
1414
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

tests/pytest/package_manager/test_cocoapods.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_cocoapods -o tests/result/cocoapods -m cocoapods"
88
]
99

1010

11-
def test_cocoapods_get_dependency(run_command):
12-
for command in COMMANDS:
11+
def test_ubuntu(run_command):
12+
for command in UBUNTU_COMMANDS:
1313
return_code, stdout, stderr = run_command(command)
1414
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

tests/pytest/package_manager/test_gradle.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_gradle/jib -o tests/result/gradle",
88
"fosslight_dependency -p tests/test_gradle2 -o tests/result/gradle2"
99
]
1010

1111

12-
def test_gradle_get_dependency(run_command):
13-
for command in COMMANDS:
12+
def test_ubuntu(run_command):
13+
for command in UBUNTU_COMMANDS:
1414
return_code, stdout, stderr = run_command(command)
1515
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

tests/pytest/package_manager/test_helm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_helm -o tests/result/helm -m helm"
88
]
99

1010

11-
def test_helm_get_dependency(run_command):
12-
for command in COMMANDS:
11+
def test_ubuntu(run_command):
12+
for command in UBUNTU_COMMANDS:
1313
return_code, stdout, stderr = run_command(command)
1414
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

tests/pytest/package_manager/test_maven.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_maven1/lombok.maven -o tests/result/maven1",
88
"fosslight_dependency -p tests/test_maven2 -o tests/result/maven2"
99
]
1010

1111

12-
def test_maven_get_dependency(run_command):
13-
for command in COMMANDS:
12+
def test_ubuntu(run_command):
13+
for command in UBUNTU_COMMANDS:
1414
return_code, stdout, stderr = run_command(command)
1515
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

tests/pytest/package_manager/test_npm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_npm1 -o tests/result/npm1",
88
"fosslight_dependency -p tests/test_npm2 -o tests/result/npm2 -m npm"
99
]
1010

1111

12-
def test_npm_get_dependency(run_command):
13-
for command in COMMANDS:
12+
def test_ubuntu(run_command):
13+
for command in UBUNTU_COMMANDS:
1414
return_code, stdout, stderr = run_command(command)
1515
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

tests/pytest/package_manager/test_nuget.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_nuget -o tests/result/nuget1",
88
"fosslight_dependency -p tests/test_nuget2 -o tests/result/nuget2"
99
]
1010

1111

12-
def test_nuget_get_dependency(run_command):
13-
for command in COMMANDS:
12+
def test_ubuntu(run_command):
13+
for command in UBUNTU_COMMANDS:
1414
return_code, stdout, stderr = run_command(command)
1515
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

tests/pytest/package_manager/test_pub.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Copyright (c) 2021 LG Electronics Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6-
COMMANDS = [
6+
UBUNTU_COMMANDS = [
77
"fosslight_dependency -p tests/test_pub -o tests/result/pub",
88
"fosslight_dependency -p tests/test_exclude -e requirements.txt -o tests/result/exclude"
99
]
1010

1111

12-
def test_pub_get_dependency(run_command):
13-
for command in COMMANDS:
12+
def test_ubuntu(run_command):
13+
for command in UBUNTU_COMMANDS:
1414
return_code, stdout, stderr = run_command(command)
1515
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"

0 commit comments

Comments
 (0)