Пример #1
0
 def test_token_cache(self):
     # unittests are singlethreaded so don't lock explicit (speed)
     # anyway token_cache should normally not be accessed outside of token property
     provider = DummyProvider()
     self.assertEqual(provider.token, 1)
     self.assertEqual(provider.token_cache.token, 1)
     expires = provider.token_cache.expires
     provider.clear_token_cache()
     provider.token
     self.assertGreater(provider.token_cache.expires, expires)
     expires = provider.token_cache.expires
     provider.token
     self.assertGreater(provider.token_cache.expires, expires)
Пример #2
0
 def test_no_token_cache(self):
     provider = DummyProvider()
     provider.token_cache = None
     self.assertEqual(provider.token, 1)
     provider.clear_token_cache()