Skip to content

Commit

Permalink
Normalize keyring monkeypatch
Browse files Browse the repository at this point in the history
  • Loading branch information
bhrutledge committed May 28, 2022
1 parent 5b2275f commit eecdc9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_auth.py
Expand Up @@ -20,7 +20,7 @@ class MockKeyring:
def get_credential(system, user):
return None

monkeypatch.setattr(auth, "keyring", MockKeyring())
monkeypatch.setattr(auth, "keyring", MockKeyring)

username = auth.Resolver(config, auth.CredentialInput()).username
assert username == "entered user"
Expand Down Expand Up @@ -135,7 +135,7 @@ class FailKeyring:
def get_credential(system, username):
raise RuntimeError("fail!")

monkeypatch.setattr(auth, "keyring", FailKeyring())
monkeypatch.setattr(auth, "keyring", FailKeyring)

assert auth.Resolver(config, auth.CredentialInput()).username == "entered user"

Expand All @@ -156,7 +156,7 @@ class FailKeyring:
def get_password(system, username):
raise RuntimeError("fail!")

monkeypatch.setattr(auth, "keyring", FailKeyring())
monkeypatch.setattr(auth, "keyring", FailKeyring)

assert auth.Resolver(config, auth.CredentialInput()).password == "entered pw"

Expand All @@ -183,7 +183,7 @@ class FailKeyring:
def get_credential(system, username):
_raise_home_key_error()

monkeypatch.setattr(auth, "keyring", FailKeyring())
monkeypatch.setattr(auth, "keyring", FailKeyring)

assert auth.Resolver(config, auth.CredentialInput()).username == "entered user"

Expand All @@ -205,7 +205,7 @@ class FailKeyring:
def get_password(system, username):
_raise_home_key_error()

monkeypatch.setattr(auth, "keyring", FailKeyring())
monkeypatch.setattr(auth, "keyring", FailKeyring)

assert auth.Resolver(config, auth.CredentialInput()).password == "entered pw"

Expand Down

0 comments on commit eecdc9f

Please sign in to comment.