Files
the-littlest-jupyterhub/integration-tests/plugins/simplest/tljh_simplest.py

64 lines
1.1 KiB
Python
Raw Normal View History

2018-08-12 09:47:32 -07:00
"""
Simplest plugin that exercises all the hooks
2018-08-12 09:47:32 -07:00
"""
2019-06-27 11:45:36 +02:00
from textwrap import dedent
from tljh import systemd
2018-08-12 09:47:32 -07:00
from tljh.hooks import hookimpl
@hookimpl
def tljh_extra_user_conda_packages():
return [
'hypothesis',
]
@hookimpl
def tljh_extra_user_pip_packages():
return [
'django',
]
@hookimpl
def tljh_extra_hub_pip_packages():
return [
'there',
]
2018-08-12 09:47:32 -07:00
@hookimpl
def tljh_extra_apt_packages():
return [
'sl',
]
@hookimpl
def tljh_config_post_install(config):
# Put an arbitrary marker we can test for
config['simplest_plugin'] = {
'present': True
}
@hookimpl
def tljh_custom_jupyterhub_config(c):
2019-06-27 11:45:36 +02:00
c.JupyterHub.authenticator_class = 'tmpauthenticator.TmpAuthenticator'
@hookimpl
def tljh_post_install():
post_install_service = dedent("""
[Unit]
Description=Post Install Test Service
[Service]
ExecStart=ls
[Install]
WantedBy=multi-user.target
""")
service = "post-install-test.service"
systemd.install_unit(service, post_install_service)
systemd.enable_service(service)
systemd.reload_daemon()