[pypy-commit] pypy default: whitespace
bdkearns
noreply at buildbot.pypy.org
Wed Feb 6 08:27:31 CET 2013
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r60896:0fa34dc08184
Date: 2013-02-06 01:16 -0500
http://bitbucket.org/pypy/pypy/changeset/0fa34dc08184/
Log: whitespace
diff --git a/pypy/module/bz2/test/test_bz2_compdecomp.py b/pypy/module/bz2/test/test_bz2_compdecomp.py
--- a/pypy/module/bz2/test/test_bz2_compdecomp.py
+++ b/pypy/module/bz2/test/test_bz2_compdecomp.py
@@ -12,7 +12,7 @@
if os.name == "nt":
from py.test import skip
skip("bz2 module is not available on Windows")
-
+
def setup_module(mod):
DATA = 'BZh91AY&SY.\xc8N\x18\x00\x01>_\x80\x00\x10@\x02\xff\xf0\x01\x07n\x00?\xe7\xff\xe00\x01\x99\xaa\x00\xc0\x03F\x86\x8c#&\x83F\x9a\x03\x06\xa6\xd0\xa6\x93M\x0fQ\xa7\xa8\x06\x804hh\x12$\x11\xa4i4\xf14S\xd2<Q\xb5\x0fH\xd3\xd4\xdd\xd5\x87\xbb\xf8\x94\r\x8f\xafI\x12\xe1\xc9\xf8/E\x00pu\x89\x12]\xc9\xbbDL\nQ\x0e\t1\x12\xdf\xa0\xc0\x97\xac2O9\x89\x13\x94\x0e\x1c7\x0ed\x95I\x0c\xaaJ\xa4\x18L\x10\x05#\x9c\xaf\xba\xbc/\x97\x8a#C\xc8\xe1\x8cW\xf9\xe2\xd0\xd6M\xa7\x8bXa<e\x84t\xcbL\xb3\xa7\xd9\xcd\xd1\xcb\x84.\xaf\xb3\xab\xab\xad`n}\xa0lh\tE,\x8eZ\x15\x17VH>\x88\xe5\xcd9gd6\x0b\n\xe9\x9b\xd5\x8a\x99\xf7\x08.K\x8ev\xfb\xf7xw\xbb\xdf\xa1\x92\xf1\xdd|/";\xa2\xba\x9f\xd5\xb1#A\xb6\xf6\xb3o\xc9\xc5y\\\xebO\xe7\x85\x9a\xbc\xb6f8\x952\xd5\xd7"%\x89>V,\xf7\xa6z\xe2\x9f\xa3\xdf\x11\x11"\xd6E)I\xa9\x13^\xca\xf3r\xd0\x03U\x922\xf26\xec\xb6\xed\x8b\xc3U\x13\x9d\xc5\x170\xa4\xfa^\x92\xacDF\x8a\x97\xd6\x19\xfe\xdd\xb8\xbd\x1a\x9a\x19\xa3\x80ankR\x8b\xe5\xd83]\xa9\xc6\x08\x82f\xf6\xb9"6l$\xb8j@\xc0\x8a\xb0l1..\xbak\x83ls\x15\xbc\xf4\xc1\x13\xbe\xf8E\xb8\x9d\r\xa8\x9dk\x84\xd3n\xfa\xacQ\x07\xb1%y\xaav\xb4\x08\xe0z\x1b\x16\xf5\x04\xe9\xcc\xb9\x08z\x1en7.G\xfc]\xc9\x14\xe1B@\xbb!8`'
@@ -54,27 +54,27 @@
def test_creation(self):
from bz2 import BZ2Compressor
-
+
raises(TypeError, BZ2Compressor, "foo")
raises(ValueError, BZ2Compressor, 10)
-
+
BZ2Compressor(1)
BZ2Compressor(9)
-
+
def test_compress(self):
from bz2 import BZ2Compressor
-
+
bz2c = BZ2Compressor()
raises(TypeError, bz2c.compress)
data = bz2c.compress(self.TEXT)
data = "%s%s" % (data, bz2c.flush())
assert self.decompress(data) == self.TEXT
-
+
def test_compress_huge_data(self):
if not self.HUGE_OK:
skip("skipping test requiring lots of memory")
- from bz2 import BZ2Compressor
-
+ from bz2 import BZ2Compressor
+
HUGE_DATA = self.TEXT * 10000
bz2c = BZ2Compressor()
raises(TypeError, bz2c.compress)
@@ -83,8 +83,8 @@
assert self.decompress(data) == HUGE_DATA
def test_compress_chunks_10(self):
- from bz2 import BZ2Compressor
-
+ from bz2 import BZ2Compressor
+
bz2c = BZ2Compressor()
n = 0
data = ""
@@ -112,23 +112,23 @@
cls.w_TEXT = cls.space.wrap(TEXT)
cls.w_DATA = cls.space.wrap(DATA)
cls.w_BUGGY_DATA = cls.space.wrap(BUGGY_DATA)
-
+
def test_creation(self):
from bz2 import BZ2Decompressor
-
+
raises(TypeError, BZ2Decompressor, "foo")
-
+
BZ2Decompressor()
-
+
def test_attribute(self):
from bz2 import BZ2Decompressor
-
+
bz2d = BZ2Decompressor()
assert bz2d.unused_data == ""
def test_decompress(self):
from bz2 import BZ2Decompressor
-
+
bz2d = BZ2Decompressor()
raises(TypeError, bz2d.decompress)
decompressed_data = bz2d.decompress(self.DATA)
@@ -136,7 +136,7 @@
def test_decompress_chunks_10(self):
from bz2 import BZ2Decompressor
-
+
bz2d = BZ2Decompressor()
decompressed_data = ""
n = 0
@@ -146,13 +146,13 @@
break
decompressed_data = "%s%s" % (decompressed_data, bz2d.decompress(temp))
n += 1
-
+
assert decompressed_data == self.TEXT
-
+
def test_decompress_unused_data(self):
# test with unused data. (data after EOF)
from bz2 import BZ2Decompressor
-
+
bz2d = BZ2Decompressor()
unused_data = "this is unused data"
decompressed_data = bz2d.decompress(self.DATA + unused_data)
@@ -161,7 +161,7 @@
def test_EOF_error(self):
from bz2 import BZ2Decompressor
-
+
bz2d = BZ2Decompressor()
bz2d.decompress(self.DATA)
raises(EOFError, bz2d.decompress, "foo")
@@ -195,11 +195,11 @@
def test_compress_function(self):
from bz2 import compress
-
+
raises(TypeError, compress, 123)
raises(ValueError, compress, "foo", 10)
raises(TypeError, compress, "foo", "foo")
-
+
data = compress(self.TEXT)
assert self.decompress(data) == self.TEXT
@@ -207,7 +207,7 @@
if not self.HUGE_OK:
skip("skipping test requiring lots of memory")
from bz2 import compress
-
+
HUGE_DATA = self.TEXT * 10000
data = compress(HUGE_DATA)
@@ -215,7 +215,7 @@
def test_decompress_function(self):
import bz2
-
+
raises(TypeError, bz2.decompress)
assert bz2.decompress("") == ""
decompressed_data = bz2.decompress(self.DATA)
diff --git a/pypy/module/bz2/test/test_bz2_file.py b/pypy/module/bz2/test/test_bz2_file.py
--- a/pypy/module/bz2/test/test_bz2_file.py
+++ b/pypy/module/bz2/test/test_bz2_file.py
@@ -85,15 +85,15 @@
assert bz2f.closed == False
bz2f.close()
assert bz2f.closed == True
-
+
def test_creation(self):
from bz2 import BZ2File
-
+
raises(ValueError, BZ2File, self.temppath, mode='w', compresslevel=10)
raises(ValueError, BZ2File, self.temppath, mode='XYZ')
# XXX the following is fine, currently:
#raises(ValueError, BZ2File, self.temppath, mode='ww')
-
+
BZ2File(self.temppath, mode='wU', buffering=0, compresslevel=8)
BZ2File(self.temppath, mode='wb')
# a large buf size
@@ -101,50 +101,50 @@
def test_close(self):
from bz2 import BZ2File
-
+
# writeonly
bz2f = BZ2File(self.temppath, mode='w')
bz2f.close()
# since we use fclose() internally you can't close it twice
# bz2f.close()
-
+
# readonly
bz2f = BZ2File(self.temppath, mode='r')
bz2f.close()
-
+
def test_tell(self):
from bz2 import BZ2File
-
+
bz2f = BZ2File(self.temppath, mode='w')
bz2f.close()
raises(ValueError, bz2f.tell)
-
+
bz2f = BZ2File(self.temppath, mode='w')
pos = bz2f.tell()
bz2f.close()
assert pos == 0
-
+
def test_seek(self):
from bz2 import BZ2File
-
+
# hack to create a foo file
open(self.temppath, "w").close()
-
+
# cannot seek if close
bz2f = BZ2File(self.temppath, mode='r')
bz2f.close()
raises(ValueError, bz2f.seek, 0)
-
+
# cannot seek if 'w'
bz2f = BZ2File(self.temppath, mode='w')
raises(IOError, bz2f.seek, 0)
bz2f.close()
-
+
bz2f = BZ2File(self.temppath, mode='r')
raises(TypeError, bz2f.seek)
raises(TypeError, bz2f.seek, "foo")
raises(TypeError, bz2f.seek, 0, "foo")
-
+
bz2f.seek(0)
assert bz2f.tell() == 0
del bz2f # delete from this frame, which is captured in the traceback
@@ -152,21 +152,21 @@
def test_open_close_del(self):
from bz2 import BZ2File
self.create_temp_file()
-
+
for i in range(10):
f = BZ2File(self.temppath)
f.close()
del f
-
+
def test_open_non_existent(self):
from bz2 import BZ2File
raises(IOError, BZ2File, "/non/existent/path")
-
+
def test_open_mode_U(self):
# bug #1194181: bz2.BZ2File opened for write with mode "U"
from bz2 import BZ2File
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath, "U")
bz2f.close()
f = open(self.temppath)
@@ -174,7 +174,7 @@
f.read()
assert f.tell() == len(self.DATA)
f.close()
-
+
def test_seek_forward(self):
from bz2 import BZ2File
self.create_temp_file()
@@ -214,7 +214,7 @@
assert bz2f.tell() == len(self.TEXT)
assert bz2f.read() == ""
bz2f.close()
-
+
def test_seek_post_end_twice(self):
from bz2 import BZ2File
self.create_temp_file()
@@ -240,7 +240,7 @@
from bz2 import BZ2File
from cStringIO import StringIO
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath)
# XXX
#raises(TypeError, bz2f.readline, None)
@@ -253,7 +253,7 @@
def test_read(self):
from bz2 import BZ2File
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath)
# XXX
# raises(TypeError, bz2f.read, None)
@@ -291,7 +291,7 @@
def test_read_chunk9(self):
from bz2 import BZ2File
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath)
text_read = ""
while True:
@@ -305,7 +305,7 @@
def test_read_100_bytes(self):
from bz2 import BZ2File
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath)
assert bz2f.read(100) == self.TEXT[:100]
bz2f.close()
@@ -313,7 +313,7 @@
def test_universal_newlines_lf(self):
from bz2 import BZ2File
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath, "rU")
assert bz2f.read() == self.TEXT
assert bz2f.newlines == "\n"
@@ -322,7 +322,7 @@
def test_universal_newlines_crlf(self):
from bz2 import BZ2File
self.create_temp_file(crlf=True)
-
+
bz2f = BZ2File(self.temppath, "rU")
data = bz2f.read()
assert data == self.TEXT
@@ -333,7 +333,7 @@
from bz2 import BZ2File
from cStringIO import StringIO
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath)
# XXX
#raises(TypeError, bz2f.readlines, None)
@@ -345,17 +345,17 @@
from bz2 import BZ2File
from cStringIO import StringIO
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath)
sio = StringIO(self.TEXT)
assert list(iter(bz2f)) == sio.readlines()
bz2f.close()
-
+
def test_xreadlines(self):
from bz2 import BZ2File
from cStringIO import StringIO
self.create_temp_file()
-
+
bz2f = BZ2File(self.temppath)
sio = StringIO(self.TEXT)
assert list(bz2f.xreadlines()) == sio.readlines()
@@ -364,12 +364,12 @@
def test_readlines_bug_1191043(self):
# readlines()/xreadlines() for files containing no newline
from bz2 import BZ2File
-
+
DATA = 'BZh91AY&SY\xd9b\x89]\x00\x00\x00\x03\x80\x04\x00\x02\x00\x0c\x00 \x00!\x9ah3M\x13<]\xc9\x14\xe1BCe\x8a%t'
f = open(self.temppath, "wb")
f.write(DATA)
f.close()
-
+
bz2f = BZ2File(self.temppath)
lines = bz2f.readlines()
bz2f.close()
@@ -379,7 +379,7 @@
xlines = list(bz2f.xreadlines())
bz2f.close()
assert xlines == ['Test']
-
+
def test_write(self):
from bz2 import BZ2File
@@ -387,7 +387,7 @@
raises(TypeError, bz2f.write)
bz2f.write(self.TEXT)
bz2f.close()
-
+
f = open(self.temppath, "rb")
assert self.decompress(f.read()) == self.TEXT
f.close()
@@ -401,11 +401,11 @@
data = self.TEXT[n * 10:(n + 1) * 10]
if not data:
break
-
+
bz2f.write(data)
n += 1
bz2f.close()
-
+
f = open(self.temppath, "rb")
assert self.decompress(f.read()) == self.TEXT
f.close()
@@ -422,7 +422,7 @@
f = open(self.temppath, "rb")
assert self.decompress(f.read()) == self.TEXT
f.close()
-
+
def test_write_methods_on_readonly_file(self):
from bz2 import BZ2File
@@ -453,8 +453,8 @@
assert data == "abc"
assert f.closed
-
-
+
+
# has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx", "riscos")
#
# if has_cmdline_bunzip2:
More information about the pypy-commit
mailing list