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
63c1081a
Commit
63c1081a
authored
Nov 09, 2002
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OK -- all tests pass on Windows now. The rest were due to 3 more
binary-vs-text-mode screwups.
parent
9de06bd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
22 deletions
+5
-22
Lib/test/test_bz2.py
Lib/test/test_bz2.py
+5
-22
No files found.
Lib/test/test_bz2.py
View file @
63c1081a
...
...
@@ -33,22 +33,9 @@ class BaseTest(unittest.TestCase):
else
:
# popen2.Popen3 doesn't exist on Windows, and even if it did, bunzip2
# isn't available to run.
# XXX This alternative doesn't work in all tests. It raises
# XXX ValueError: couldn't find end of stream
# XXX in
# XXX testWrite
# XXX testWriteChunks10
# XXX testWriteLines
# XXX from BZ2FileTest .
# XXX I don't know why.
def
decompress
(
self
,
data
):
return
bz2
.
decompress
(
data
)
# XXX See XXX comment above.
skip_mystery_test
=
not
has_cmdline_bunzip2
class
BZ2FileTest
(
BaseTest
):
"Test MCRYPT type miscelaneous methods."
...
...
@@ -145,20 +132,18 @@ class BZ2FileTest(BaseTest):
bz2f
.
close
()
def
testWrite
(
self
):
if
self
.
skip_mystery_test
:
return
#
if self.skip_mystery_test:
#
return
# "Test BZ2File.write()"
bz2f
=
BZ2File
(
self
.
filename
,
"w"
)
bz2f
.
write
(
self
.
TEXT
)
bz2f
.
close
()
f
=
open
(
self
.
filename
)
f
=
open
(
self
.
filename
,
'rb'
)
self
.
assertEqual
(
self
.
decompress
(
f
.
read
()),
self
.
TEXT
)
f
.
close
()
def
testWriteChunks10
(
self
):
# "Test BZ2File.write() with chunks of 10 bytes"
if
self
.
skip_mystery_test
:
return
bz2f
=
BZ2File
(
self
.
filename
,
"w"
)
n
=
0
while
1
:
...
...
@@ -168,19 +153,17 @@ class BZ2FileTest(BaseTest):
bz2f
.
write
(
str
)
n
+=
1
bz2f
.
close
()
f
=
open
(
self
.
filename
)
f
=
open
(
self
.
filename
,
'rb'
)
self
.
assertEqual
(
self
.
decompress
(
f
.
read
()),
self
.
TEXT
)
f
.
close
()
def
testWriteLines
(
self
):
# "Test BZ2File.writelines()"
if
self
.
skip_mystery_test
:
return
bz2f
=
BZ2File
(
self
.
filename
,
"w"
)
sio
=
StringIO
(
self
.
TEXT
)
bz2f
.
writelines
(
sio
.
readlines
())
bz2f
.
close
()
f
=
open
(
self
.
filename
)
f
=
open
(
self
.
filename
,
'rb'
)
self
.
assertEqual
(
self
.
decompress
(
f
.
read
()),
self
.
TEXT
)
f
.
close
()
...
...
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