mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Merge #11488 patch from 3.2.
This commit is contained in:
commit
af9be20060
2 changed files with 18 additions and 0 deletions
|
@ -704,6 +704,23 @@ class test_SpooledTemporaryFile(TC):
|
||||||
f.write(b'x')
|
f.write(b'x')
|
||||||
self.assertTrue(f._rolled)
|
self.assertTrue(f._rolled)
|
||||||
|
|
||||||
|
def test_writelines(self):
|
||||||
|
# Verify writelines with a SpooledTemporaryFile
|
||||||
|
f = self.do_create()
|
||||||
|
f.writelines((b'x', b'y', b'z'))
|
||||||
|
f.seek(0)
|
||||||
|
buf = f.read()
|
||||||
|
self.assertEqual(buf, b'xyz')
|
||||||
|
|
||||||
|
def test_writelines_sequential(self):
|
||||||
|
# A SpooledTemporaryFile should hold exactly max_size bytes, and roll
|
||||||
|
# over afterward
|
||||||
|
f = self.do_create(max_size=35)
|
||||||
|
f.writelines((b'x' * 20, b'x' * 10, b'x' * 5))
|
||||||
|
self.assertFalse(f._rolled)
|
||||||
|
f.write(b'x')
|
||||||
|
self.assertTrue(f._rolled)
|
||||||
|
|
||||||
def test_sparse(self):
|
def test_sparse(self):
|
||||||
# A SpooledTemporaryFile that is written late in the file will extend
|
# A SpooledTemporaryFile that is written late in the file will extend
|
||||||
# when that occurs
|
# when that occurs
|
||||||
|
|
|
@ -197,6 +197,7 @@ Brian Curtin
|
||||||
Lisandro Dalcin
|
Lisandro Dalcin
|
||||||
Andrew Dalke
|
Andrew Dalke
|
||||||
Lars Damerow
|
Lars Damerow
|
||||||
|
Evan Dandrea
|
||||||
Eric Daniel
|
Eric Daniel
|
||||||
Scott David Daniels
|
Scott David Daniels
|
||||||
Ben Darnell
|
Ben Darnell
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue