generated from cisagov/ScubaGear
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get latest created GWSBaselineConformance dir
- Loading branch information
1 parent
6dbffbf
commit 5f0a90d
Showing
2 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
import pytest | ||
import subprocess | ||
import os | ||
|
||
""" | ||
Test virtualenv setup, activation | ||
|
@@ -23,14 +24,21 @@ class TestScuba: | |
# print(result.stderr) | ||
|
||
|
||
def test_cli(self): | ||
command = f"scubagoggles gws --subjectemail [email protected] --quiet" | ||
def test_cli(self, subjectemail): | ||
command = f"scubagoggles gws --subjectemail {subjectemail} --quiet -b commoncontrols" | ||
result = subprocess.run(command) | ||
print(result) | ||
print(result.stderr) | ||
|
||
if result.returncode != 0: | ||
raise AssertionError(f"Expected 0, but got {result.returncode}") | ||
|
||
cwd = os.getcwd() | ||
print(cwd) | ||
prefix = "GWSBaselineConformance" | ||
|
||
directories = [d for d in os.listdir() if os.path.isdir(d) and d.startswith(prefix)] | ||
directories.sort(key=lambda d: os.path.getctime(d), reverse=True) | ||
print(directories) | ||
print(directories[0]) | ||
|
||
|
||
#def create_venv(env): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import pytest | ||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--subjectemail", action="store") | ||
|
||
@pytest.fixture | ||
def subjectemail(pytestconfig): | ||
return pytestconfig.getoption("subjectemail") |