1from PyObjCTools.TestSupport import * 2from Foundation import * 3 4try: 5 unicode 6except NameError: 7 unicode = str 8 9class TestNSLocale (TestCase): 10 def testConstants(self): 11 self.assertIsInstance(NSCurrentLocaleDidChangeNotification, unicode) 12 self.assertIsInstance(NSLocaleIdentifier, unicode) 13 self.assertIsInstance(NSLocaleLanguageCode, unicode) 14 self.assertIsInstance(NSLocaleCountryCode, unicode) 15 self.assertIsInstance(NSLocaleScriptCode, unicode) 16 self.assertIsInstance(NSLocaleVariantCode, unicode) 17 self.assertIsInstance(NSLocaleExemplarCharacterSet, unicode) 18 self.assertIsInstance(NSLocaleCalendar, unicode) 19 self.assertIsInstance(NSLocaleCollationIdentifier, unicode) 20 self.assertIsInstance(NSLocaleUsesMetricSystem, unicode) 21 self.assertIsInstance(NSLocaleMeasurementSystem, unicode) 22 self.assertIsInstance(NSLocaleDecimalSeparator, unicode) 23 self.assertIsInstance(NSLocaleGroupingSeparator, unicode) 24 self.assertIsInstance(NSLocaleCurrencySymbol, unicode) 25 self.assertIsInstance(NSLocaleCurrencyCode, unicode) 26 self.assertIsInstance(NSGregorianCalendar, unicode) 27 self.assertIsInstance(NSBuddhistCalendar, unicode) 28 self.assertIsInstance(NSChineseCalendar, unicode) 29 self.assertIsInstance(NSHebrewCalendar, unicode) 30 self.assertIsInstance(NSIslamicCalendar, unicode) 31 self.assertIsInstance(NSIslamicCivilCalendar, unicode) 32 self.assertIsInstance(NSJapaneseCalendar, unicode) 33 34 @min_os_level('10.6') 35 def testConstants10_6(self): 36 self.assertIsInstance(NSLocaleCollatorIdentifier, unicode) 37 self.assertIsInstance(NSLocaleQuotationBeginDelimiterKey, unicode) 38 self.assertIsInstance(NSLocaleQuotationEndDelimiterKey, unicode) 39 self.assertIsInstance(NSLocaleAlternateQuotationBeginDelimiterKey, unicode) 40 self.assertIsInstance(NSLocaleAlternateQuotationEndDelimiterKey, unicode) 41 self.assertIsInstance(NSRepublicOfChinaCalendar, unicode) 42 self.assertIsInstance(NSPersianCalendar, unicode) 43 self.assertIsInstance(NSIndianCalendar, unicode) 44 self.assertIsInstance(NSISO8601Calendar, unicode) 45 46 self.assertEqual(NSLocaleLanguageDirectionUnknown, kCFLocaleLanguageDirectionUnknown) 47 self.assertEqual(NSLocaleLanguageDirectionLeftToRight, kCFLocaleLanguageDirectionLeftToRight) 48 self.assertEqual(NSLocaleLanguageDirectionRightToLeft, kCFLocaleLanguageDirectionRightToLeft) 49 self.assertEqual(NSLocaleLanguageDirectionTopToBottom, kCFLocaleLanguageDirectionTopToBottom) 50 self.assertEqual(NSLocaleLanguageDirectionBottomToTop, kCFLocaleLanguageDirectionBottomToTop) 51 52 53if __name__ == "__main__": 54 main() 55