diff --git a/integration-tests/plugins/simplest/tljh_simplest.py b/integration-tests/plugins/simplest/tljh_simplest.py index f77f19b..d9176de 100644 --- a/integration-tests/plugins/simplest/tljh_simplest.py +++ b/integration-tests/plugins/simplest/tljh_simplest.py @@ -51,4 +51,4 @@ def tljh_post_install(): @hookimpl def tljh_new_user_create(username): with open('test_new_user_create', 'w') as f: - f.write("a new userfile") + f.write(username) diff --git a/integration-tests/test_simplest_plugin.py b/integration-tests/test_simplest_plugin.py index d2f973c..0b7afd3 100644 --- a/integration-tests/test_simplest_plugin.py +++ b/integration-tests/test_simplest_plugin.py @@ -5,7 +5,9 @@ from ruamel.yaml import YAML import requests import os import subprocess + from tljh.config import CONFIG_FILE, USER_ENV_PREFIX, HUB_ENV_PREFIX +from tljh import user yaml = YAML(typ='rt') @@ -74,11 +76,15 @@ def test_post_install_hook(): assert content == "123456789" -def test_tljh_new_user_create(): +def test_new_user_create(): """ Test that plugin receives username as arg """ - with open("test_new_user_create") as f: + username="user1" + # Call ensure_user to make sure the user plugin gets called + user.ensure_user(username) + + with open(f"test_new_user_create") as f: content = f.read() - assert content == "a new userfile" + assert content == username