MCPcopy Create free account
hub / github.com/getsentry/sentry / test_encoding_wrapper

Function test_encoding_wrapper

tests/sentry/utils/kvstore/test_encoding.py:18–25  ·  view source on GitHub ↗
(store: KVStorage[str, bytes])

Source from the content-addressed store, hash-verified

16
17
18def test_encoding_wrapper(store: KVStorage[str, bytes]) -> None:
19 wrapper = KVStorageCodecWrapper(store, JSONCodec() | BytesCodec())
20
21 wrapper.set("key", [1, 2, 3])
22 assert store.get("key") == b"[1,2,3]"
23
24 assert wrapper.get("key") == [1, 2, 3]
25 assert [*wrapper.get_many(["key", "missing"])] == [("key", [1, 2, 3])]

Callers

nothing calls this directly

Calls 7

setMethod · 0.95
getMethod · 0.95
JSONCodecClass · 0.90
BytesCodecClass · 0.90
getMethod · 0.65
get_manyMethod · 0.45

Tested by

no test coverage detected