def test_password_set_failure(self, monkeypatch): def mockreturn(system, username, password): return False monkeypatch.setattr(keyring, "set_password", mockreturn) keyring.set_keyring(TestKeyring()) result = credentials.password_set('user', 'password') assert not result
def test_password_set(self): keyring.set_keyring(TestKeyring()) result = credentials.password_set('user', 'password') assert result