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

Method test_small

python/python3/tornado/test/iostream_test.py:1247–1271  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1245 self.assertEqual(len(buf), 0)
1246
1247 def test_small(self):
1248 objs = [b"12", b"345", b"67", b"89a", b"bcde", b"fgh", b"ijklmn"]
1249
1250 buf = self.make_streambuffer()
1251 self.check_append_all_then_skip_all(buf, objs, bytes)
1252
1253 buf = self.make_streambuffer()
1254 self.check_append_all_then_skip_all(buf, objs, bytearray)
1255
1256 buf = self.make_streambuffer()
1257 self.check_append_all_then_skip_all(buf, objs, memoryview)
1258
1259 # Test internal algorithm
1260 buf = self.make_streambuffer(10)
1261 for i in range(9):
1262 buf.append(b"x")
1263 self.assertEqual(len(buf._buffers), 1)
1264 for i in range(9):
1265 buf.append(b"x")
1266 self.assertEqual(len(buf._buffers), 2)
1267 buf.advance(10)
1268 self.assertEqual(len(buf._buffers), 1)
1269 buf.advance(8)
1270 self.assertEqual(len(buf._buffers), 0)
1271 self.assertEqual(len(buf), 0)
1272
1273 def test_large(self):
1274 objs = [

Callers

nothing calls this directly

Calls 4

make_streambufferMethod · 0.95
advanceMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected