mirror of
https://github.com/python/cpython
synced 2026-09-29 10:15:30 +03:00
Use BytesIO instead of cStringIO.StringIO.
This commit is contained in:
parent
1bba9db0c3
commit
48f4cf9b94
1 changed files with 5 additions and 5 deletions
|
|
@ -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 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
|
|||
@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…
Add table
Add a link
Reference in a new issue