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

Function test_packer

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

Source from the content-addressed store, hash-verified

116
117
118def test_packer():
119 data = os.urandom(1024)
120 packer = salt.utils.msgpack.Packer()
121 unpacker = msgpack.Unpacker(None)
122
123 packed = packer.pack(data)
124 # Sanity Check
125 assert packed
126 assert data != packed
127
128 # Reverse the packing and the result should be equivalent to the original data
129 unpacker.feed(packed)
130 unpacked = msgpack.unpackb(packed)
131 assert data == unpacked
132
133
134def test_unpacker():

Callers

nothing calls this directly

Calls 2

feedMethod · 0.80
packMethod · 0.45

Tested by

no test coverage detected