MCPcopy Index your code
hub / github.com/python/cpython / test_from_file

Method test_from_file

Lib/test/test_pickletools.py:101–113  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

99 ])
100
101 def test_from_file(self):
102 f = io.BytesIO(b'prefix(I123\nK\x12J\x12\x34\x56\x78t.suffix')
103 self.assertEqual(f.read(6), b'prefix')
104 it = pickletools.genops(f)
105 self.assertEqual([(item[0].name,) + item[1:] for item in it], [
106 ('MARK', None, 6),
107 ('INT', 123, 7),
108 ('BININT1', 0x12, 12),
109 ('BININT', 0x78563412, 14),
110 ('TUPLE', None, 19),
111 ('STOP', None, 20),
112 ])
113 self.assertEqual(f.read(), b'suffix')
114
115 def test_without_pos(self):
116 f = SimpleReader(b'(I123\nK\x12J\x12\x34\x56\x78t.')

Callers

nothing calls this directly

Calls 2

readMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected