mirror of
https://github.com/python/cpython
synced 2024-09-15 22:10:19 +00:00
Use BytesIO instead of cStringIO.StringIO.
This commit is contained in:
parent
1bba9db0c3
commit
48f4cf9b94
|
@ -1,7 +1,7 @@
|
|||
from test import test_support
|
||||
import unittest
|
||||
|
||||
import sys, os, cStringIO, subprocess
|
||||
import sys, os, io, subprocess
|
||||
import quopri
|
||||
|
||||
|
||||
|
@ -145,16 +145,16 @@ def test_idempotent_string(self):
|
|||
@withpythonimplementation
|
||||
def test_encode(self):
|
||||
for p, e in self.STRINGS:
|
||||
infp = cStringIO.StringIO(p)
|
||||
outfp = cStringIO.StringIO()
|
||||
infp = io.BytesIO(p)
|
||||
outfp = io.BytesIO()
|
||||
quopri.encode(infp, outfp, quotetabs=False)
|
||||
self.assertEqual(outfp.getvalue(), e)
|
||||
|
||||
@withpythonimplementation
|
||||
def test_decode(self):
|
||||
for p, e in self.STRINGS:
|
||||
infp = cStringIO.StringIO(e)
|
||||
outfp = cStringIO.StringIO()
|
||||
infp = io.BytesIO(e)
|
||||
outfp = io.BytesIO()
|
||||
quopri.decode(infp, outfp)
|
||||
self.assertEqual(outfp.getvalue(), p)
|
||||
|
||||
|
|
Loading…
Reference in a new issue