Kaydet (Commit) 48f4cf9b authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Use BytesIO instead of cStringIO.StringIO.

üst 1bba9db0
from test import test_support from test import test_support
import unittest import unittest
import sys, os, cStringIO, subprocess import sys, os, io, subprocess
import quopri import quopri
...@@ -145,16 +145,16 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''') ...@@ -145,16 +145,16 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
@withpythonimplementation @withpythonimplementation
def test_encode(self): def test_encode(self):
for p, e in self.STRINGS: for p, e in self.STRINGS:
infp = cStringIO.StringIO(p) infp = io.BytesIO(p)
outfp = cStringIO.StringIO() outfp = io.BytesIO()
quopri.encode(infp, outfp, quotetabs=False) quopri.encode(infp, outfp, quotetabs=False)
self.assertEqual(outfp.getvalue(), e) self.assertEqual(outfp.getvalue(), e)
@withpythonimplementation @withpythonimplementation
def test_decode(self): def test_decode(self):
for p, e in self.STRINGS: for p, e in self.STRINGS:
infp = cStringIO.StringIO(e) infp = io.BytesIO(e)
outfp = cStringIO.StringIO() outfp = io.BytesIO()
quopri.decode(infp, outfp) quopri.decode(infp, outfp)
self.assertEqual(outfp.getvalue(), p) self.assertEqual(outfp.getvalue(), p)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment