Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4b96eb44
Commit
4b96eb44
authored
Mar 14, 2011
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port #11488 patch from 3.1 (changeset f816841bab03)
parent
601da6a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
Lib/test/test_tempfile.py
Lib/test/test_tempfile.py
+17
-0
Misc/ACKS
Misc/ACKS
+1
-0
No files found.
Lib/test/test_tempfile.py
View file @
4b96eb44
...
@@ -689,6 +689,23 @@ class test_SpooledTemporaryFile(TC):
...
@@ -689,6 +689,23 @@ class test_SpooledTemporaryFile(TC):
f
.
write
(
'x'
)
f
.
write
(
'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
...
...
Misc/ACKS
View file @
4b96eb44
...
@@ -182,6 +182,7 @@ Brian Curtin
...
@@ -182,6 +182,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment