summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_codecs.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-22 12:17:08 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-22 12:17:08 (GMT)
commit2233d27a3f9c946a1c9e3a7dd45728d819170bc0 (patch)
tree0cdbd75e212313d866ad52d43fb00813df290439 /Lib/test/test_codecs.py
parent63a28be01693584afcadc39ca650efc5fa8f2880 (diff)
downloadcpython-2233d27a3f9c946a1c9e3a7dd45728d819170bc0.zip
cpython-2233d27a3f9c946a1c9e3a7dd45728d819170bc0.tar.gz
cpython-2233d27a3f9c946a1c9e3a7dd45728d819170bc0.tar.bz2
Change readbuffer_encode() and charbuffer_encode() to
return bytes objects.
Diffstat (limited to 'Lib/test/test_codecs.py')
-rw-r--r--Lib/test/test_codecs.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index 666f0df..89a3473 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -422,12 +422,12 @@ class ReadBufferTest(unittest.TestCase):
def test_array(self):
import array
self.assertEqual(
- codecs.readbuffer_encode(array.array("c", "spam")),
- ("spam", 4)
+ codecs.readbuffer_encode(array.array("b", bytes("spam"))),
+ (b"spam", 4)
)
def test_empty(self):
- self.assertEqual(codecs.readbuffer_encode(""), ("", 0))
+ self.assertEqual(codecs.readbuffer_encode(""), (b"", 0))
def test_bad_args(self):
self.assertRaises(TypeError, codecs.readbuffer_encode)
@@ -436,10 +436,10 @@ class ReadBufferTest(unittest.TestCase):
class CharBufferTest(unittest.TestCase):
def test_string(self):
- self.assertEqual(codecs.charbuffer_encode("spam"), ("spam", 4))
+ self.assertEqual(codecs.charbuffer_encode("spam"), (b"spam", 4))
def test_empty(self):
- self.assertEqual(codecs.charbuffer_encode(""), ("", 0))
+ self.assertEqual(codecs.charbuffer_encode(""), (b"", 0))
def test_bad_args(self):
self.assertRaises(TypeError, codecs.charbuffer_encode)