コード例 #1
0
 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)
コード例 #2
0
ファイル: test_gce.py プロジェクト: zcourts/oauth2client
 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)
コード例 #3
0
ファイル: test_gce.py プロジェクト: elibixby/oauth2client
 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)
コード例 #4
0
ファイル: test_gce.py プロジェクト: Natarajan-R/oauth2client
 def test_to_json(self):
     credentials = AppAssertionCredentials()
     with self.assertRaises(NotImplementedError):
         credentials.to_json()
コード例 #5
0
 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)
コード例 #6
0
ファイル: test_gce.py プロジェクト: rzs840707/oauth2client
 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)