def test_to_json_and_from_json(self): credentials = AppAssertionCredentials( scope=['http://example.com/a', 'http://example.com/b']) json = credentials.to_json() credentials_from_json = Credentials.new_from_json(json) self.assertEqual(credentials.access_token, credentials_from_json.access_token)
def test_serialize_deserialize(self, get_metadata): credentials = AppAssertionCredentials() credentials_from_json = Credentials.new_from_json( credentials.to_json()) self.assertEqual( credentials.service_account_info, credentials_from_json.service_account_info)
def test_to_json(self): credentials = AppAssertionCredentials() with self.assertRaises(NotImplementedError): credentials.to_json()
def test_to_json_and_from_json(self): credentials = AppAssertionCredentials() json = credentials.to_json() credentials_from_json = Credentials.new_from_json(json) self.assertEqual(credentials.access_token, credentials_from_json.access_token)