fix flake8
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Rio Liu 2021-08-30 23:52:37 -04:00
parent 36def99b28
commit 6577fb3ea6
1 changed files with 7 additions and 7 deletions

View File

@ -1,15 +1,17 @@
from click.testing import CliRunner
from ceo.cli import cli
def test_positions(cli_setup):
runner = CliRunner()
# Setup test data
for i in range(5):
runner.invoke(cli, ['members', 'add', f'test_{i}', '--cn', f'Test {i}', '--program', 'Math', '--terms', '1' ], input='y\n')
runner.invoke(cli, ['members', 'add', f'test_{i}', '--cn', f'Test {i}', '--program', 'Math', '--terms', '1'], input='y\n')
runner.invoke(cli, ['groups', 'add', 'exec', '--description', 'Test Group'], input='y\n')
result = runner.invoke(cli, ['positions', 'set',
result = runner.invoke(cli, [
'positions', 'set',
'--president', 'test_0',
'--vice-president', 'test_1',
'--sysadmin', 'test_2',
@ -18,8 +20,7 @@ def test_positions(cli_setup):
], input='y\n')
assert result.exit_code == 0
assert result.output == \
'''
assert result.output == '''
The positions will be updated:
president: test_0
vice_president: test_1
@ -36,12 +37,11 @@ Update positions in LDAP... Done
Update executive group in LDAP... Done
Subscribe to mailing lists... Done
Transaction successfully completed.
'''[1:]
'''[1:] # noqa: W291
result = runner.invoke(cli, ['positions', 'get'])
assert result.exit_code == 0
assert result.output == \
'''
assert result.output == '''
president: test_0
secretary: test_3
sysadmin: test_2