forked from fosslight/fosslight_dependency_scanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_android.py
30 lines (23 loc) · 1011 Bytes
/
test_android.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
#!/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_android -o tests/result/android -m android"
]
DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")
INPUT_PATH = os.path.join("tests", "test_android", "sunflower")
OUTPUT_PATH = os.path.join("tests", "result", "android")
WINDOW_COMMANDS = [f"{DIST_PATH} -p {INPUT_PATH} -o {OUTPUT_PATH}"]
@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}"