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