MCPcopy
hub / github.com/saltstack/salt / test_array_size

Function test_array_size

tests/pytests/unit/utils/test_msgpack.py:150–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148
149
150def test_array_size():
151 sizes = [0, 5, 50, 1000]
152 bio = io.BytesIO()
153 packer = salt.utils.msgpack.Packer()
154 for size in sizes:
155 bio.write(packer.pack_array_header(size))
156 for i in range(size):
157 bio.write(packer.pack(i))
158
159 bio.seek(0)
160 unpacker = salt.utils.msgpack.Unpacker(bio, use_list=True)
161 for size in sizes:
162 assert unpacker.unpack() == list(range(size))
163
164
165def test_manual_reset():

Callers

nothing calls this directly

Calls 4

unpackMethod · 0.80
listFunction · 0.50
writeMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected