summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-03 16:28:47 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-03 16:28:47 (GMT)
commit99c0c223e297866b55920dc1f15bade93004c5f9 (patch)
treed044673ff480497ec1ba0e9fad532aae629b2fa3
parent6b826abc707eb101f8426382487de88cd4e7b046 (diff)
downloadcpython-99c0c223e297866b55920dc1f15bade93004c5f9.zip
cpython-99c0c223e297866b55920dc1f15bade93004c5f9.tar.gz
cpython-99c0c223e297866b55920dc1f15bade93004c5f9.tar.bz2
Fix test_struct. A bunch of array and bytes issues.
-rw-r--r--Lib/test/test_struct.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 3c43cc2..69057fc 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -578,8 +578,8 @@ def test_unpack_from():
simple_err(struct.unpack_from, fmt, data, i)
def test_pack_into():
- test_string = 'Reykjavik rocks, eow!'
- writable_buf = array.array('c', ' '*100)
+ test_string = b'Reykjavik rocks, eow!'
+ writable_buf = array.array('b', b' '*100)
fmt = '21s'
s = struct.Struct(fmt)
@@ -594,13 +594,13 @@ def test_pack_into():
vereq(from_buf, test_string[:10] + test_string)
# Go beyond boundaries.
- small_buf = array.array('c', ' '*10)
+ small_buf = array.array('b', b' '*10)
assertRaises(struct.error, s.pack_into, small_buf, 0, test_string)
assertRaises(struct.error, s.pack_into, small_buf, 2, test_string)
def test_pack_into_fn():
- test_string = 'Reykjavik rocks, eow!'
- writable_buf = array.array('c', ' '*100)
+ test_string = b'Reykjavik rocks, eow!'
+ writable_buf = array.array('b', b' '*100)
fmt = '21s'
pack_into = lambda *args: struct.pack_into(fmt, *args)
@@ -615,7 +615,7 @@ def test_pack_into_fn():
vereq(from_buf, test_string[:10] + test_string)
# Go beyond boundaries.
- small_buf = array.array('c', ' '*10)
+ small_buf = array.array('b', b' '*10)
assertRaises(struct.error, pack_into, small_buf, 0, test_string)
assertRaises(struct.error, pack_into, small_buf, 2, test_string)