-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cleanup-tokens-test_cli
- Loading branch information
Showing
2 changed files
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,8 @@ def test_token_inspect(token_placement, default_token, monkeypatch, caplog, tmpd | |
monkeypatch.setenv('ODA_TOKEN', '') | ||
|
||
if token_placement == 'env': | ||
monkeypatch.setenv('ODA_TOKEN', default_token) | ||
monkeypatch.setenv('ODA_TOKEN', default_token) | ||
|
||
elif token_placement == 'cwddotfile': | ||
with open(oda_token_cwd_fn, "w") as f: | ||
f.write(default_token) | ||
|
@@ -57,15 +57,18 @@ def test_token_modify(default_token, secret_key, monkeypatch, caplog): | |
assert '"msdone": false' not in caplog.text | ||
|
||
runner = CliRunner() | ||
result = runner.invoke(cli.tokencli, ['-s', secret_key, 'modify', "--disable-email", "--new-validity-hours", "100"], obj={}) | ||
result = runner.invoke(cli.tokencli, ['-s', secret_key, 'modify', "--disable-email", "--new-validity-hours", "100", "--disable-matrix", "--matrix-room-id", "test_room_id:matrix.org"], obj={}) | ||
assert result.exit_code == 0 | ||
|
||
assert '"sub": "[email protected]"' in caplog.text | ||
assert 'your current token payload:' in caplog.text | ||
assert 'your new token payload:' in caplog.text | ||
assert '"msdone": false' in caplog.text | ||
assert '"mssub": false' in caplog.text | ||
|
||
assert '"mssub": false' in caplog.text | ||
assert '"mxdone": false' in caplog.text | ||
assert '"mxsub": false' in caplog.text | ||
assert '"mxroomid": "test_room_id:matrix.org"' in caplog.text | ||
|
||
def test_get(dispatcher_live_fixture, caplog, monkeypatch, tmpdir): | ||
runner = CliRunner() | ||
result = runner.invoke(cli.cli, ['-u', dispatcher_live_fixture, 'get'], obj={}) | ||
|