mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Add tests for the plugin mechanism
This commit is contained in:
47
integration-tests/test_simplest_plugin.py
Normal file
47
integration-tests/test_simplest_plugin.py
Normal file
@@ -0,0 +1,47 @@
|
||||
"""
|
||||
Test simplest plugin
|
||||
"""
|
||||
from ruamel.yaml import YAML
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
yaml = YAML(typ='rt')
|
||||
|
||||
|
||||
def test_apt_packages():
|
||||
"""
|
||||
Test extra apt packages are installed
|
||||
"""
|
||||
assert os.path.exists('/usr/bin/sl')
|
||||
|
||||
|
||||
def test_pip_packages():
|
||||
"""
|
||||
Test extra user pip packages are installed
|
||||
"""
|
||||
subprocess.check_call([
|
||||
'/opt/tljh/user/bin/python3',
|
||||
'-c',
|
||||
'import django'
|
||||
])
|
||||
|
||||
|
||||
def test_conda_packages():
|
||||
"""
|
||||
Test extra user conda packages are installed
|
||||
"""
|
||||
subprocess.check_call([
|
||||
'/opt/tljh/user/bin/python3',
|
||||
'-c',
|
||||
'import hypothesis'
|
||||
])
|
||||
|
||||
|
||||
def test_config_hook():
|
||||
"""
|
||||
Check config changes are present
|
||||
"""
|
||||
with open('/opt/tljh/config.yaml') as f:
|
||||
data = yaml.load(f)
|
||||
|
||||
assert data['simplest_plugin']['present']
|
||||
Reference in New Issue
Block a user