mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
- added (c)StringIO tests; cStringIO usage failed in the previous
version of plistlib.py (r1.2)
This commit is contained in:
parent
94af32e244
commit
bcc58e87e8
1 changed files with 16 additions and 0 deletions
|
@ -49,6 +49,22 @@ class TestPlistlib(unittest.TestCase):
|
||||||
pl2 = plistlib.Plist.fromFile(test_support.TESTFN)
|
pl2 = plistlib.Plist.fromFile(test_support.TESTFN)
|
||||||
self.assertEqual(dict(pl), dict(pl2))
|
self.assertEqual(dict(pl), dict(pl2))
|
||||||
|
|
||||||
|
def test_stringio(self):
|
||||||
|
from StringIO import StringIO
|
||||||
|
f = StringIO()
|
||||||
|
pl = self._create()
|
||||||
|
pl.write(f)
|
||||||
|
pl2 = plistlib.Plist.fromFile(StringIO(f.getvalue()))
|
||||||
|
self.assertEqual(dict(pl), dict(pl2))
|
||||||
|
|
||||||
|
def test_cstringio(self):
|
||||||
|
from cStringIO import StringIO
|
||||||
|
f = StringIO()
|
||||||
|
pl = self._create()
|
||||||
|
pl.write(f)
|
||||||
|
pl2 = plistlib.Plist.fromFile(StringIO(f.getvalue()))
|
||||||
|
self.assertEqual(dict(pl), dict(pl2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue