Exemple #1
0
 def test_cache_no_fallthrough_expiration_time_fn(self):
     # Since we do not re-configure the cache region, for ease of testing
     # this value is set the same as the expiration_time default in the
     # [cache] section
     cache_time = 600
     expiration_time = cache.get_expiration_time_fn('role')
     do_test = self._get_cache_fallthrough_fn(cache_time)
     # Run the test with the assignment cache_time value
     self.config_fixture.config(cache_time=cache_time, group='role')
     test_value = TestProxyValue(uuid.uuid4().hex)
     self.assertEqual(cache_time, expiration_time())
     do_test(value=test_value)
 def test_cache_no_fallthrough_expiration_time_fn(self):
     # Since we do not re-configure the cache region, for ease of testing
     # this value is set the same as the expiration_time default in the
     # [cache] section
     cache_time = 600
     expiration_time = cache.get_expiration_time_fn("role")
     do_test = self._get_cache_fallthrough_fn(cache_time)
     # Run the test with the assignment cache_time value
     self.config_fixture.config(cache_time=cache_time, group="role")
     test_value = TestProxyValue(uuid.uuid4().hex)
     self.assertEqual(cache_time, expiration_time())
     do_test(value=test_value)
Exemple #3
0
 def test_cache_fallthrough_expiration_time_fn(self):
     # Since we do not re-configure the cache region, for ease of testing
     # this value is set the same as the expiration_time default in the
     # [cache] section
     cache_time = 599
     expiration_time = cache.get_expiration_time_fn('role')
     do_test = self._get_cache_fallthrough_fn(cache_time)
     # Run the test with the assignment cache_time value set to None and
     # the global value set.
     self.config_fixture.config(cache_time=None, group='role')
     test_value = TestProxyValue(uuid.uuid4().hex)
     self.assertIsNone(expiration_time())
     do_test(value=test_value)