1from Foundation import *
2from PyObjCTools.TestSupport import *
3
4class TestNSPropertyList (TestCase):
5    def testMethods(self):
6        self.assertResultIsBOOL(NSPropertyListSerialization.propertyList_isValidForFormat_)
7        self.assertArgIsOut(NSPropertyListSerialization.dataFromPropertyList_format_errorDescription_, 2)
8        self.assertArgIsOut(NSPropertyListSerialization.propertyListFromData_mutabilityOption_format_errorDescription_, 3)
9
10    @min_os_level('10.6')
11    def testMethods10_6(self):
12        self.assertArgIsOut(NSPropertyListSerialization.dataWithPropertyList_format_options_error_, 3)
13        self.assertArgIsOut(NSPropertyListSerialization.writePropertyList_toStream_format_options_error_, 4)
14        self.assertArgIsOut(NSPropertyListSerialization.propertyListWithData_options_format_error_, 3)
15        self.assertArgIsOut(NSPropertyListSerialization.propertyListWithStream_options_format_error_, 3)
16
17    @min_os_level('10.7')
18    def testConstants10_7(self):
19        self.assertEqual(NSPropertyListImmutable, kCFPropertyListImmutable)
20        self.assertEqual(NSPropertyListMutableContainers, kCFPropertyListMutableContainers)
21        self.assertEqual(NSPropertyListMutableContainersAndLeaves, kCFPropertyListMutableContainersAndLeaves)
22
23        self.assertEqual(NSPropertyListOpenStepFormat, kCFPropertyListOpenStepFormat)
24        self.assertEqual(NSPropertyListXMLFormat_v1_0, kCFPropertyListXMLFormat_v1_0)
25        self.assertEqual(NSPropertyListBinaryFormat_v1_0, kCFPropertyListBinaryFormat_v1_0)
26
27if __name__ == "__main__":
28    main()
29