def test__expires_in_not_expired(self, utcnow):
credentials = client.OAuth2Credentials(None, None, None, None,
None, None, None)
credentials.token_expiry = datetime.datetime.utcnow()
seconds = 1234
now = credentials.token_expiry - datetime.timedelta(seconds=seconds)
self.assertLess(now, credentials.token_expiry)
utcnow.return_value = now
self.assertEqual(credentials._expires_in(), seconds)
utcnow.assert_called_once_with()
评论列表
文章目录