Skip to content

Commit

Permalink
Add test capturing new expectation that an empty password found in th…
Browse files Browse the repository at this point in the history
…e config should bypass the prompt. Ref #426.
  • Loading branch information
jaraco committed Feb 9, 2019
1 parent cad2ccf commit 3c0ad12
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ def test_no_password_defers_to_prompt(monkeypatch):
assert pw == 'entered pw'


def test_empty_password_bypasses_prompt(monkeypatch):
monkeypatch.setattr(utils, 'password_prompt', lambda prompt: 'entered pw')
pw = utils.get_password('system', 'user', None, {'password': ''})
assert pw == ''


def test_get_username_and_password_keyring_overrides_prompt(monkeypatch):
import collections
Credential = collections.namedtuple('Credential', 'username password')
Expand Down

0 comments on commit 3c0ad12

Please sign in to comment.