-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test capturing expectation that the password prompt occurs if no …
- Loading branch information
Showing
1 changed file
with
6 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,6 +249,12 @@ def get_password(system, user): | |
assert pw == 'entered pw' | ||
|
||
|
||
def test_no_password_defers_to_prompt(monkeypatch): | ||
monkeypatch.setattr(utils, 'password_prompt', lambda prompt: 'entered pw') | ||
pw = utils.get_password('system', 'user', None, {'password': None}) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jaraco
Author
Member
|
||
assert pw == 'entered pw' | ||
|
||
|
||
def test_get_username_and_password_keyring_overrides_prompt(monkeypatch): | ||
import collections | ||
Credential = collections.namedtuple('Credential', 'username password') | ||
|
By passing
{'password': None}
as argument, you're configuring it to be anonymous, which is the purpose of #426.So, not asking for prompt is the desired behavior.