fix flake8
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
36def99b28
commit
6577fb3ea6
|
@ -1,15 +1,17 @@
|
||||||
from click.testing import CliRunner
|
from click.testing import CliRunner
|
||||||
from ceo.cli import cli
|
from ceo.cli import cli
|
||||||
|
|
||||||
|
|
||||||
def test_positions(cli_setup):
|
def test_positions(cli_setup):
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
|
|
||||||
# Setup test data
|
# Setup test data
|
||||||
for i in range(5):
|
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')
|
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',
|
'--president', 'test_0',
|
||||||
'--vice-president', 'test_1',
|
'--vice-president', 'test_1',
|
||||||
'--sysadmin', 'test_2',
|
'--sysadmin', 'test_2',
|
||||||
|
@ -18,8 +20,7 @@ def test_positions(cli_setup):
|
||||||
], input='y\n')
|
], input='y\n')
|
||||||
|
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert result.output == \
|
assert result.output == '''
|
||||||
'''
|
|
||||||
The positions will be updated:
|
The positions will be updated:
|
||||||
president: test_0
|
president: test_0
|
||||||
vice_president: test_1
|
vice_president: test_1
|
||||||
|
@ -36,12 +37,11 @@ Update positions in LDAP... Done
|
||||||
Update executive group in LDAP... Done
|
Update executive group in LDAP... Done
|
||||||
Subscribe to mailing lists... Done
|
Subscribe to mailing lists... Done
|
||||||
Transaction successfully completed.
|
Transaction successfully completed.
|
||||||
'''[1:]
|
'''[1:] # noqa: W291
|
||||||
|
|
||||||
result = runner.invoke(cli, ['positions', 'get'])
|
result = runner.invoke(cli, ['positions', 'get'])
|
||||||
assert result.exit_code == 0
|
assert result.exit_code == 0
|
||||||
assert result.output == \
|
assert result.output == '''
|
||||||
'''
|
|
||||||
president: test_0
|
president: test_0
|
||||||
secretary: test_3
|
secretary: test_3
|
||||||
sysadmin: test_2
|
sysadmin: test_2
|
||||||
|
|
Loading…
Reference in New Issue