MCPcopy Create free account
hub / github.com/EasyIME/PIME / check_peek

Method check_peek

python/python3/tornado/test/iostream_test.py:1218–1225  ·  view source on GitHub ↗
(self, buf, expected)

Source from the content-addressed store, hash-verified

1216 return buf
1217
1218 def check_peek(self, buf, expected):
1219 size = 1
1220 while size < 2 * len(expected):
1221 got = self.to_bytes(buf.peek(size))
1222 self.assertTrue(got) # Not empty
1223 self.assertLessEqual(len(got), size)
1224 self.assertTrue(expected.startswith(got), (expected, got))
1225 size = (size * 3 + 1) // 2
1226
1227 def check_append_all_then_skip_all(self, buf, objs, input_type):
1228 self.assertEqual(len(buf), 0)

Callers 1

Calls 2

to_bytesMethod · 0.95
peekMethod · 0.80

Tested by

no test coverage detected