def test_exchange_code_and_file_for_token(self):
payload = (b'{'
b' "access_token":"asdfghjkl",'
b' "expires_in":3600'
b'}')
http = http_mock.HttpMock(data=payload)
credentials = client.credentials_from_clientsecrets_and_code(
datafile('client_secrets.json'), self.scope,
self.code, http=http)
self.assertEqual(credentials.access_token, 'asdfghjkl')
self.assertNotEqual(None, credentials.token_expiry)
self.assertEqual(set(['foo']), credentials.scopes)
评论列表
文章目录