MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_unpack_with_buffer

Method test_unpack_with_buffer

Lib/test/test_struct.py:497–503  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

495 self._test_pack_into(pack_into)
496
497 def test_unpack_with_buffer(self):
498 # SF bug 1563759: struct.unpack doesn't support buffer protocol objects
499 data1 = array.array('B', b'\x12\x34\x56\x78')
500 data2 = memoryview(b'\x12\x34\x56\x78') # XXX b'......XXXX......', 6, 4
501 for data in [data1, data2]:
502 value, = struct.unpack('>I', data)
503 self.assertEqual(value, 0x12345678)
504
505 def test_bool(self):
506 class ExplodingBool(object):

Callers

nothing calls this directly

Calls 2

unpackMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected