use variables in test_simplest_plugin

avoids updating hardcoded paths when they change
This commit is contained in:
Min RK
2018-08-31 12:25:30 +02:00
parent 5df106fa82
commit 626e492e0f

View File

@@ -4,6 +4,7 @@ Test simplest plugin
from ruamel.yaml import YAML from ruamel.yaml import YAML
import os import os
import subprocess import subprocess
from tljh.config import CONFIG_FILE, USER_ENV_PREFIX
yaml = YAML(typ='rt') yaml = YAML(typ='rt')
@@ -20,7 +21,7 @@ def test_pip_packages():
Test extra user pip packages are installed Test extra user pip packages are installed
""" """
subprocess.check_call([ subprocess.check_call([
'/opt/tljh/user/bin/python3', f'{USER_ENV_PREFIX}/bin/python3',
'-c', '-c',
'import django' 'import django'
]) ])
@@ -31,7 +32,7 @@ def test_conda_packages():
Test extra user conda packages are installed Test extra user conda packages are installed
""" """
subprocess.check_call([ subprocess.check_call([
'/opt/tljh/user/bin/python3', f'{USER_ENV_PREFIX}/bin/python3',
'-c', '-c',
'import hypothesis' 'import hypothesis'
]) ])
@@ -41,7 +42,7 @@ def test_config_hook():
""" """
Check config changes are present Check config changes are present
""" """
with open('/opt/tljh/config.yaml') as f: with open(CONFIG_FILE) as f:
data = yaml.load(f) data = yaml.load(f)
assert data['simplest_plugin']['present'] assert data['simplest_plugin']['present']