def test_update_api_key_can_raise_operation_not_complete_exception(
         self, mock_store_wrapper):
     with self.assertRaises(OperationNotCompletedException):
         credential_provider = KeystoreCredentialsProvider()
         credential_provider.update_api_key_entry('someusertoupdate',
                                                  MockCredentials,
                                                  'newapikey')
 def test_update_api_key_calls_methods_properly(self, mock_store_wrapper):
     # mock_store_wrapper.set_password.return_value=None
     credential_provider = KeystoreCredentialsProvider()
     credential_provider.update_api_key_entry('someusertoupdate',
                                              MockCredentials, 'newapikey')
     calls = [
         call(TEST_HOSTNAME, MACHINE, TEST_HOSTNAME),
         call(TEST_HOSTNAME, USERNAME, 'someusertoupdate'),
         call(TEST_HOSTNAME, PASSWORD, 'newapikey')
     ]
     mock_store_wrapper.assert_has_calls(calls)