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
d89ee79d
Commit
d89ee79d
authored
Mar 14, 2011
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#11488: Add tests for writelines method of SpooledTemporaryFile.
Patch by Evan Dandrea.
parent
8fea2e6a
Changes
2
Show 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 @
d89ee79d
...
...
@@ -697,6 +697,23 @@ class test_SpooledTemporaryFile(TC):
f
.
write
(
b'x'
)
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
):
# A SpooledTemporaryFile that is written late in the file will extend
# when that occurs
...
...
Misc/ACKS
View file @
d89ee79d
...
...
@@ -176,6 +176,7 @@ Tom Culliton
Lisandro Dalcin
Andrew Dalke
Lars Damerow
Evan Dandrea
Eric Daniel
Scott David Daniels
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