MCPcopy Index your code
hub / github.com/saltstack/salt / check_pack_unicode

Function check_pack_unicode

tests/pytests/unit/utils/test_msgpack.py:335–345  ·  view source on GitHub ↗
(pack_func, unpack_func)

Source from the content-addressed store, hash-verified

333
334
335def check_pack_unicode(pack_func, unpack_func):
336 test_data = ["", "abcd", ["defgh"], "Русский текст"]
337 for td in test_data:
338 ret = unpack_func(pack_func(td), use_list=True, **raw)
339 assert ret == td
340 packer = salt.utils.msgpack.Packer()
341 data = packer.pack(td)
342 ret = salt.utils.msgpack.Unpacker(
343 io.BytesIO(data), use_list=True, **raw
344 ).unpack()
345 assert ret == td
346
347
348def check_pack_bytes(pack_func, unpack_func):

Callers

nothing calls this directly

Calls 2

unpackMethod · 0.80
packMethod · 0.45

Tested by

no test coverage detected