-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fallback to raw_input/getpass for missing username/password.
- Loading branch information
Showing
4 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
Empty file.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
import pytest | ||
|
||
from twine.commands import upload | ||
|
||
|
||
@pytest.mark.parametrize( | ||
('cli_value', 'config', 'key', 'strategy', 'expected'), | ||
( | ||
('cli', {}, 'key', lambda: 'fallback', 'cli'), | ||
(None, {'key': 'value'}, 'key', lambda: 'fallback', 'value'), | ||
(None, {}, 'key', lambda: 'fallback', 'fallback'), | ||
), | ||
) | ||
def test_get_userpass_value(cli_value, config, key, strategy, expected): | ||
ret = upload.get_userpass_value(cli_value, config, key, strategy) | ||
assert ret == expected |
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