MCPcopy
hub / github.com/h2oai/wave / test_cache

Method test_cache

py/tests/test_python_server_async.py:49–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 assert svg.index('<svg') == 0
48
49 async def test_cache(self):
50 d1 = dict(foo='bar', qux=42)
51 await self.site.cache.set('test', 'data', d1)
52 keys = await self.site.cache.keys('test')
53 assert len(keys) == 1
54 assert keys[0] == 'data'
55 d2 = await self.site.cache.get('test', 'data')
56 assert isinstance(d2, dict)
57 assert d2['foo'] == d1['foo']
58 assert d2['qux'] == d1['qux']
59
60 async def test_multipart_server(self):
61 file_handle = open('../assets/brand/wave.svg', 'rb')

Callers

nothing calls this directly

Calls 4

dictFunction · 0.85
setMethod · 0.65
getMethod · 0.65
keysMethod · 0.45

Tested by

no test coverage detected