def testUploadAccount(self):
    hash_algorithm = gitkitclient.ALGORITHM_HMAC_SHA256
    try:
        hash_key = bytes('key123', 'utf-8')
    except __HOLE__:
        hash_key = 'key123'
    upload_user = gitkitclient.GitkitUser.FromDictionary({
        'email': self.email,
        'localId': self.user_id,
        'displayName': self.user_name,
        'photoUrl': self.user_photo
    })
    with mock.patch('identitytoolkit.rpchelper.RpcHelper._InvokeGitkitApi') as rpc_mock:
      rpc_mock.return_value = {}
      self.gitkitclient.UploadUsers(hash_algorithm, hash_key, [upload_user])
      expected_param = {
          'hashAlgorithm': hash_algorithm,
          'signerKey': base64.urlsafe_b64encode(hash_key),
          'users': [{
              'email': self.email,
              'localId': self.user_id,
              'displayName': self.user_name,
              'photoUrl': self.user_photo
          }]
      }
      rpc_mock.assert_called_with('uploadAccount', expected_param)
dataset/ETHPy150Open google/identity-toolkit-python-client/tests/test_gitkitclient.py/GitkitClientTestCase.testUploadAccount