1 # Copyright (C) 2003 Python Software Foundation
6 from test
import test_support
8 class TestPlistlib(unittest
.TestCase
):
12 os
.unlink(test_support
.TESTFN
)
19 aList
=["A", "B", 12, 32.1, [1, 2, 3]],
23 anotherString
="<hello & hi there!>",
24 aUnicodeValue
=u
'M\xe4ssig, Ma\xdf',
28 someData
= plistlib
.Data("<binary gunk>"),
29 someMoreData
= plistlib
.Data("<lots of binary gunk>" * 10),
33 from xml
.utils
.iso8601
import parse
38 pl
['aDate'] = plistlib
.Date(time
.mktime(time
.gmtime()))
41 def test_create(self
):
43 self
.assertEqual(pl
["aString"], "Doodah")
44 self
.assertEqual(pl
["aDict"]["aFalseValue"], False)
48 pl
.write(test_support
.TESTFN
)
49 pl2
= plistlib
.Plist
.fromFile(test_support
.TESTFN
)
50 self
.assertEqual(dict(pl
), dict(pl2
))
55 test_support
.run_unittest(TestPlistlib
)
58 if __name__
== '__main__':