mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
55 lines
1.0 KiB
Python
55 lines
1.0 KiB
Python
"""
|
|
Test simplest plugin
|
|
"""
|
|
from ruamel.yaml import YAML
|
|
import os
|
|
import subprocess
|
|
from tljh.config import CONFIG_FILE, USER_ENV_PREFIX, HUB_ENV_PREFIX
|
|
|
|
yaml = YAML(typ='rt')
|
|
|
|
|
|
def test_apt_packages():
|
|
"""
|
|
Test extra apt packages are installed
|
|
"""
|
|
assert os.path.exists('/usr/games/sl')
|
|
|
|
|
|
def test_pip_packages():
|
|
"""
|
|
Test extra user & hub pip packages are installed
|
|
"""
|
|
subprocess.check_call([
|
|
f'{USER_ENV_PREFIX}/bin/python3',
|
|
'-c',
|
|
'import django'
|
|
])
|
|
|
|
subprocess.check_call([
|
|
f'{HUB_ENV_PREFIX}/bin/python3',
|
|
'-c',
|
|
'import there'
|
|
])
|
|
|
|
|
|
def test_conda_packages():
|
|
"""
|
|
Test extra user conda packages are installed
|
|
"""
|
|
subprocess.check_call([
|
|
f'{USER_ENV_PREFIX}/bin/python3',
|
|
'-c',
|
|
'import hypothesis'
|
|
])
|
|
|
|
|
|
def test_config_hook():
|
|
"""
|
|
Check config changes are present
|
|
"""
|
|
with open(CONFIG_FILE) as f:
|
|
data = yaml.load(f)
|
|
|
|
assert data['simplest_plugin']['present']
|