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

Method test_arbitrary_buffer

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

Source from the content-addressed store, hash-verified

884 self.assertRaises(StopIteration, next, it)
885
886 def test_arbitrary_buffer(self):
887 s = struct.Struct('>IB')
888 b = bytes(range(1, 11))
889 it = s.iter_unpack(memoryview(b))
890 self.assertEqual(next(it), (0x01020304, 5))
891 self.assertEqual(next(it), (0x06070809, 10))
892 self.assertRaises(StopIteration, next, it)
893 self.assertRaises(StopIteration, next, it)
894
895 def test_length_hint(self):
896 lh = operator.length_hint

Callers

nothing calls this directly

Calls 4

nextFunction · 0.85
iter_unpackMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected