forked from fosslight/fosslight_dependency_scanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_maven.py
31 lines (24 loc) · 1.05 KB
/
test_maven.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021 LG Electronics Inc.
# SPDX-License-Identifier: Apache-2.0
import os
import pytest
UBUNTU_COMMANDS = [
"fosslight_dependency -p tests/test_maven1/lombok.maven -o tests/result/maven1",
"fosslight_dependency -p tests/test_maven2 -o tests/result/maven2"
]
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
INPUT_PATH = os.path.join("tests", "test_maven2")
OUTPUT_PATH = os.path.join("tests", "result", "maven2")
WINDOW_COMMANDS = [f"{DIST_PATH} -p {INPUT_PATH} -o {OUTPUT_PATH} -m maven"]
@pytest.mark.ubuntu
def test_ubuntu(run_command):
for command in UBUNTU_COMMANDS:
return_code, stdout, stderr = run_command(command)
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"
@pytest.mark.windows
def test_windows(run_command):
for command in WINDOW_COMMANDS:
return_code, stdout, stderr = run_command(command)
assert return_code == 0, f"Command failed: {command}\nstdout: {stdout}\nstderr: {stderr}"