Skip to content

Commit

Permalink
import getpass
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Dec 28, 2021
1 parent 80bcd0a commit 3b9ba5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions actions/create_email_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ async def process(email_server, group_path, dryrun=False, keycloak_client=None):
}

script = f'''import subprocess
import getpass
import logging
import os
logging.basicConfig(level={logger.getEffectiveLevel()})
Expand Down
6 changes: 3 additions & 3 deletions tests/actions/test_create_email_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def test_create(keycloak_bootstrap, patch_ssh_sudo):
assert patch_ssh_sudo.call_args.args[0] == 'test.test.test'

user_dict = {'testuser': {'canonical': 'first.last', 'uid': 1000, 'gid': 1000}}
assert json.loads(patch_ssh_sudo.call_args.args[1].split('\n')[5].split('=',1)[-1]) == user_dict
assert json.loads(patch_ssh_sudo.call_args.args[1].split('\n')[6].split('=',1)[-1]) == user_dict

@pytest.mark.asyncio
async def test_create_error_ssh(keycloak_bootstrap, patch_ssh_sudo):
Expand All @@ -48,7 +48,7 @@ async def test_create_not_in_group(keycloak_bootstrap, patch_ssh_sudo):
assert patch_ssh_sudo.call_args.args[0] == 'test.test.test'

user_dict = {}
assert json.loads(patch_ssh_sudo.call_args.args[1].split('\n')[5].split('=',1)[-1]) == user_dict
assert json.loads(patch_ssh_sudo.call_args.args[1].split('\n')[6].split('=',1)[-1]) == user_dict


@pytest.fixture
Expand All @@ -73,4 +73,4 @@ async def test_listener_create(keycloak_bootstrap, tmp_path, listener, patch_ssh
assert patch_ssh_sudo.call_args.args[0] == 'test.test.test'

user_dict = {'testuser': {'canonical': 'first.last', 'uid': 1000, 'gid': 1000}}
assert json.loads(patch_ssh_sudo.call_args.args[1].split('\n')[5].split('=',1)[-1]) == user_dict
assert json.loads(patch_ssh_sudo.call_args.args[1].split('\n')[6].split('=',1)[-1]) == user_dict

0 comments on commit 3b9ba5e

Please sign in to comment.