Skip to content

Commit

Permalink
Add another test to cover Credential._vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 20, 2024
1 parent b75609e commit e9f7851
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,15 @@ def test_get_anonymous(monkeypatch, mocked_get_credential, format, capsys):
tool.output_format = format
tool.do_get()
assert 's3cret' in capsys.readouterr().out


@pytest.mark.parametrize('format', ['json', 'plain'])
def test_get(monkeypatch, mocked_get_credential, format, capsys):
mocked_get_credential.return_value = credentials.SimpleCredential('alice', 's3cret')
tool = cli.CommandLineTool()
tool.service = 'svc'
tool.username = 'alice'
tool.get_mode = 'creds'
tool.output_format = format
tool.do_get()
assert 's3cret' in capsys.readouterr().out

0 comments on commit e9f7851

Please sign in to comment.