From 626e492e0ffdc258dd72b206541a94c1d5a0c2a6 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 31 Aug 2018 12:25:30 +0200 Subject: [PATCH] use variables in test_simplest_plugin avoids updating hardcoded paths when they change --- integration-tests/test_simplest_plugin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/integration-tests/test_simplest_plugin.py b/integration-tests/test_simplest_plugin.py index c35de5d..29b4fab 100644 --- a/integration-tests/test_simplest_plugin.py +++ b/integration-tests/test_simplest_plugin.py @@ -4,6 +4,7 @@ Test simplest plugin from ruamel.yaml import YAML import os import subprocess +from tljh.config import CONFIG_FILE, USER_ENV_PREFIX yaml = YAML(typ='rt') @@ -20,7 +21,7 @@ def test_pip_packages(): Test extra user pip packages are installed """ subprocess.check_call([ - '/opt/tljh/user/bin/python3', + f'{USER_ENV_PREFIX}/bin/python3', '-c', 'import django' ]) @@ -31,7 +32,7 @@ def test_conda_packages(): Test extra user conda packages are installed """ subprocess.check_call([ - '/opt/tljh/user/bin/python3', + f'{USER_ENV_PREFIX}/bin/python3', '-c', 'import hypothesis' ]) @@ -41,7 +42,7 @@ def test_config_hook(): """ Check config changes are present """ - with open('/opt/tljh/config.yaml') as f: + with open(CONFIG_FILE) as f: data = yaml.load(f) - assert data['simplest_plugin']['present'] \ No newline at end of file + assert data['simplest_plugin']['present']