def it_changes_password(self, data_source): data_source.authenticate.return_value = None data_source.set_password.return_value = None keychain = Keychain(data_source) keychain.unlock("password") keychain.set_password("foobar") data_source.set_password.assert_called_with("foobar")
def it_changes_password(self, data_source): data_source.authenticate.return_value = None data_source.set_password.return_value = None keychain = Keychain(data_source) keychain.unlock("password") keychain.set_password("foobar") data_source.set_password.assert_called_with("foobar")
def it_unlocks_the_keychain_with_the_right_password(self, data_source): keychain = Keychain(data_source) keychain.unlock('rightpassword') data_source.authenticate.assert_called_with('rightpassword')
def it_throws_if_unlocking_uninitialized_keychain(self, data_source): data_source.is_initialised.return_value = False keychain = Keychain(data_source) keychain.unlock("somepassword")
def it_throws_if_unlocking_with_incorrect_password(self, data_source): data_source.authenticate.side_effect = IncorrectPasswordException keychain = Keychain(data_source) keychain.unlock("wrongpassword")
def it_throws_if_unlocking_with_incorrect_password(self, data_source): data_source.authenticate.side_effect = IncorrectPasswordException keychain = Keychain(data_source) keychain.unlock("wrongpassword")
def it_unlocks_the_keychain_with_the_right_password(self, data_source): keychain = Keychain(data_source) keychain.unlock('rightpassword') data_source.authenticate.assert_called_with('rightpassword')
def it_throws_if_unlocking_uninitialized_keychain(self, data_source): data_source.is_initialised.return_value = False keychain = Keychain(data_source) keychain.unlock("somepassword")