Skip to content

Commit

Permalink
Fix failing plugin test
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgianaElena committed Jan 13, 2020
1 parent c6e6d6d commit 92c74d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integration-tests/plugins/simplest/tljh_simplest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 9 additions & 3 deletions integration-tests/test_simplest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
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')

Expand Down Expand Up @@ -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

0 comments on commit 92c74d1

Please sign in to comment.