mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Try to test new user create hook
This commit is contained in:
@@ -46,3 +46,9 @@ def tljh_custom_jupyterhub_config(c):
|
||||
def tljh_post_install():
|
||||
with open('test_post_install', 'w') as f:
|
||||
f.write('123456789')
|
||||
|
||||
|
||||
@hookimpl
|
||||
def tljh_new_user_create(username):
|
||||
with open('test_new_user_create', 'w') as f:
|
||||
f.write("a new userfile")
|
||||
|
||||
@@ -72,3 +72,13 @@ def test_post_install_hook():
|
||||
content = f.read()
|
||||
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user