-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tests/conftest.py : Implement `LockedBackend` inheriting `KeyringBackend` and throwing `KeyringLocked` on access. * tests\utils\test_authenticator.py : Test that locked keyrings still lead to a request. * tests\utils\test_password_manager.py : Test that locked keyrings do not fail.
- Loading branch information
1 parent
aefbbff
commit f009d7c
Showing
3 changed files
with
59 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
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 |
---|---|---|
|
@@ -94,6 +94,19 @@ def test_authenticator_uses_username_only_credentials( | |
assert request.headers["Authorization"] == "Basic Zm9vMDAxOg==" | ||
|
||
|
||
def test_authenticator_ignores_locked_keyring( | ||
mock_config: Config, | ||
mock_remote: None, | ||
http: type[httpretty.httpretty], | ||
with_locked_keyring: None, | ||
): | ||
authenticator = Authenticator(mock_config, NullIO()) | ||
authenticator.request("get", "https://[email protected]/files/foo-0.1.0.tar.gz") | ||
request = http.last_request() | ||
|
||
assert request.headers["Authorization"] == "Basic Zm9vMDAxOg==" | ||
|
||
|
||
def test_authenticator_uses_password_only_credentials( | ||
mock_config: Config, mock_remote: None, http: type[httpretty.httpretty] | ||
) -> None: | ||
|
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