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

Method test_iterate

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

Source from the content-addressed store, hash-verified

874 self.assertRaises(TypeError, iter_unpack_type)
875
876 def test_iterate(self):
877 s = struct.Struct('>IB')
878 b = bytes(range(1, 16))
879 it = s.iter_unpack(b)
880 self.assertEqual(next(it), (0x01020304, 5))
881 self.assertEqual(next(it), (0x06070809, 10))
882 self.assertEqual(next(it), (0x0b0c0d0e, 15))
883 self.assertRaises(StopIteration, next, it)
884 self.assertRaises(StopIteration, next, it)
885
886 def test_arbitrary_buffer(self):
887 s = struct.Struct('>IB')

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