Skip to content

Commit

Permalink
Merge pull request #5644 from freedomofpress/improve-asset-tests
Browse files Browse the repository at this point in the history
Improve testing of static assets in Debian packaging
  • Loading branch information
zenmonkeykstop authored Nov 19, 2020
2 parents bc80123 + eaa013a commit 9059594
Show file tree
Hide file tree
Showing 4 changed files with 360 additions and 312 deletions.
27 changes: 15 additions & 12 deletions molecule/builder-xenial/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
Import variables from vars.yml and inject into testutils namespace
"""

import os
import io
import yaml
import testutils
from pathlib import Path
import subprocess

import pytest

filepath = os.path.join(os.path.dirname(__file__), "vars.yml")
with io.open(filepath, 'r') as f:
securedrop_test_vars = yaml.safe_load(f)

# Tack on target OS for use in tests
securedrop_target_platform = os.environ.get("SECUREDROP_TARGET_PLATFORM")
securedrop_test_vars["securedrop_target_platform"] = securedrop_target_platform

testutils.securedrop_test_vars = testutils.inject_vars(securedrop_test_vars)
@pytest.fixture(scope="session")
def securedrop_root() -> Path:
"""
Returns the root of the SecureDrop working tree for the test session.
"""
return Path(
subprocess.run(
["git", "rev-parse", "--show-toplevel"], stdout=subprocess.PIPE, check=True
)
.stdout.decode("utf-8")
.strip()
)
Loading

0 comments on commit 9059594

Please sign in to comment.