@@ -171,16 +171,17 @@ def _raise_home_key_error():
171171 raise KeyError ("uid not found: 999" )
172172
173173
174- def test_get_username_keyring_missing_home_logged (monkeypatch , config , caplog ):
174+ def test_get_username_keyring_key_error_logged (
175+ entered_username , monkeypatch , config , caplog
176+ ):
175177 class FailKeyring :
176178 @staticmethod
177179 def get_credential (system , username ):
178180 _raise_home_key_error ()
179181
180182 monkeypatch .setattr (auth , "keyring" , FailKeyring ())
181183
182- resolver = auth .Resolver (config , auth .CredentialInput ())
183- assert not resolver .get_username_from_keyring ()
184+ assert auth .Resolver (config , auth .CredentialInput ()).username == "entered user"
184185
185186 assert re .search (
186187 r"Error from keyring"
@@ -192,17 +193,17 @@ def get_credential(system, username):
192193 )
193194
194195
195- def test_get_password_keyring_missing_home_logged (monkeypatch , config , caplog ):
196+ def test_get_password_keyring_key_error_logged (
197+ entered_username , entered_password , monkeypatch , config , caplog
198+ ):
196199 class FailKeyring :
197200 @staticmethod
198201 def get_password (system , username ):
199202 _raise_home_key_error ()
200203
201204 monkeypatch .setattr (auth , "keyring" , FailKeyring ())
202205
203- resolver = auth .Resolver (config , auth .CredentialInput ("user" ))
204- assert resolver .username == "user"
205- assert not resolver .get_password_from_keyring ()
206+ assert auth .Resolver (config , auth .CredentialInput ()).password == "entered pw"
206207
207208 assert re .search (
208209 r"Error from keyring"
0 commit comments