2018-07-19 17:30:09 -07:00
|
|
|
"""
|
|
|
|
|
Unit test functions in installer.py
|
|
|
|
|
"""
|
|
|
|
|
import os
|
2018-08-28 14:16:09 +02:00
|
|
|
|
|
|
|
|
from tljh import installer
|
|
|
|
|
|
2018-07-19 17:30:09 -07:00
|
|
|
|
|
|
|
|
def test_ensure_node():
|
|
|
|
|
installer.ensure_node()
|
|
|
|
|
assert os.path.exists('/usr/bin/node')
|
2018-08-28 14:16:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_ensure_config_yaml(tljh_dir):
|
|
|
|
|
pm = installer.setup_plugins()
|
|
|
|
|
installer.ensure_config_yaml(pm)
|
|
|
|
|
assert os.path.exists(installer.CONFIG_FILE)
|
|
|
|
|
assert os.path.isdir(installer.CONFIG_DIR)
|
|
|
|
|
assert os.path.isdir(os.path.join(installer.CONFIG_DIR, 'jupyterhub_config.d'))
|
2018-08-31 12:17:16 +02:00
|
|
|
# verify that old config doesn't exist
|
|
|
|
|
assert not os.path.exists(os.path.join(tljh_dir, 'config.yaml'))
|