MCPcopy Create free account
hub / github.com/psf/cachecontrol / TestRedisCache

Class TestRedisCache

tests/test_storage_redis.py:11–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class TestRedisCache:
12 def setup_method(self):
13 self.conn = Mock()
14 self.cache = RedisCache(self.conn)
15
16 def test_set_expiration_datetime(self):
17 self.cache.set("foo", "bar", expires=datetime(2014, 2, 2))
18 assert self.conn.setex.called
19
20 def test_set_expiration_datetime_aware(self):
21 self.cache.set("foo", "bar", expires=datetime(2014, 2, 2, tzinfo=timezone.utc))
22 assert self.conn.setex.called
23
24 def test_set_expiration_int(self):
25 self.cache.set("foo", "bar", expires=600)
26 assert self.conn.setex.called

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…