mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
use variables in test_simplest_plugin
avoids updating hardcoded paths when they change
This commit is contained in:
@@ -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']
|
||||||
|
|||||||
Reference in New Issue
Block a user