mirror of
https://github.com/python/cpython.git
synced 2025-08-10 20:08:47 +00:00
[3.12] gh-109848: Make test_rot13_func in test_codecs independent (GH-109850) (GH-110504)
(cherry picked from commit b987fdb19b
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
6430ca53db
commit
481aa7a40f
1 changed files with 2 additions and 1 deletions
|
@ -3567,9 +3567,10 @@ class Rot13UtilTest(unittest.TestCase):
|
||||||
$ echo "Hello World" | python -m encodings.rot_13
|
$ echo "Hello World" | python -m encodings.rot_13
|
||||||
"""
|
"""
|
||||||
def test_rot13_func(self):
|
def test_rot13_func(self):
|
||||||
|
from encodings.rot_13 import rot13
|
||||||
infile = io.StringIO('Gb or, be abg gb or, gung vf gur dhrfgvba')
|
infile = io.StringIO('Gb or, be abg gb or, gung vf gur dhrfgvba')
|
||||||
outfile = io.StringIO()
|
outfile = io.StringIO()
|
||||||
encodings.rot_13.rot13(infile, outfile)
|
rot13(infile, outfile)
|
||||||
outfile.seek(0)
|
outfile.seek(0)
|
||||||
plain_text = outfile.read()
|
plain_text = outfile.read()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue