Try to test new user create hook

This commit is contained in:
johannes.kaufmann
2019-12-03 09:43:16 +01:00
parent 1af3b71585
commit 35772cf447
2 changed files with 16 additions and 0 deletions

View File

@@ -46,3 +46,9 @@ def tljh_custom_jupyterhub_config(c):
def tljh_post_install(): def tljh_post_install():
with open('test_post_install', 'w') as f: with open('test_post_install', 'w') as f:
f.write('123456789') f.write('123456789')
@hookimpl
def tljh_new_user_create(username):
with open('test_new_user_create', 'w') as f:
f.write("a new userfile")

View File

@@ -72,3 +72,13 @@ def test_post_install_hook():
content = f.read() content = f.read()
assert content == "123456789" assert content == "123456789"
def test_tljh_new_user_create():
"""
Test that plugin receives username as arg
"""
with open("test_new_user_create") as f:
content = f.read()
assert content == "a new userfile"