Author: Brian Kearns <[email protected]>
Branch:
Changeset: r63260:9c7ae3bdbde7
Date: 2013-04-12 01:17 -0400
http://bitbucket.org/pypy/pypy/changeset/9c7ae3bdbde7/
Log: improve BytesIO.readinto() test
diff --git a/pypy/module/_io/test/test_bytesio.py
b/pypy/module/_io/test/test_bytesio.py
--- a/pypy/module/_io/test/test_bytesio.py
+++ b/pypy/module/_io/test/test_bytesio.py
@@ -74,10 +74,13 @@
import _io
b = _io.BytesIO("hello")
- a = bytearray('testing')
- assert b.readinto(a) == 5
+ a1 = bytearray('t')
+ a2 = bytearray('testing')
+ assert b.readinto(a1) == 1
+ assert b.readinto(a2) == 4
b.close()
- assert a == "hellong"
+ assert a1 == "h"
+ assert a2 == "elloing"
raises(ValueError, b.readinto, bytearray("hello"))
def test_readline(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit