Refs #33361 -- Added Added DummyCache.set() test for boolean values.

This commit is contained in:
Jeremy Lainé 2021-12-14 06:31:22 +01:00 committed by Mariusz Felisiak
parent 41329b9852
commit c7902612ca
1 changed files with 6 additions and 3 deletions

View File

@ -157,17 +157,20 @@ class DummyCacheTests(SimpleTestCase):
def test_data_types(self): def test_data_types(self):
"All data types are ignored equally by the dummy cache" "All data types are ignored equally by the dummy cache"
stuff = { tests = {
'string': 'this is a string', 'string': 'this is a string',
'int': 42, 'int': 42,
'bool': True,
'list': [1, 2, 3, 4], 'list': [1, 2, 3, 4],
'tuple': (1, 2, 3, 4), 'tuple': (1, 2, 3, 4),
'dict': {'A': 1, 'B': 2}, 'dict': {'A': 1, 'B': 2},
'function': f, 'function': f,
'class': C, 'class': C,
} }
cache.set("stuff", stuff) for key, value in tests.items():
self.assertIsNone(cache.get("stuff")) with self.subTest(key=key):
cache.set(key, value)
self.assertIsNone(cache.get(key))
def test_expiration(self): def test_expiration(self):
"Expiration has no effect on the dummy cache" "Expiration has no effect on the dummy cache"