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

Method test_bound_methods

Lib/test/test_tempfile.py:1379–1391  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1377 f.close()
1378
1379 def test_bound_methods(self):
1380 # It should be OK to steal a bound method from a SpooledTemporaryFile
1381 # and use it independently; when the file rolls over, those bound
1382 # methods should continue to function
1383 f = self.do_create(max_size=30)
1384 read = f.read
1385 write = f.write
1386 seek = f.seek
1387
1388 write(b"a" * 35)
1389 write(b"b" * 35)
1390 seek(0, 0)
1391 self.assertEqual(read(70), b'a'*35 + b'b'*35)
1392
1393 def test_properties(self):
1394 f = tempfile.SpooledTemporaryFile(max_size=10)

Callers

nothing calls this directly

Calls 4

do_createMethod · 0.95
readFunction · 0.70
writeFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected