1 2from PyObjCTools.TestSupport import * 3from CoreLocation import * 4 5class TestCLLocationManager (TestCase): 6 @min_os_level('10.6') 7 def testMethods(self): 8 self.assertResultIsBOOL(CLLocationManager.alloc().init().locationServicesEnabled) 9 10 @min_os_level('10.7') 11 def testConstants10_7(self): 12 self.assertEqual(CLDeviceOrientationUnknown, 0) 13 self.assertEqual(CLDeviceOrientationPortrait, 1) 14 self.assertEqual(CLDeviceOrientationPortraitUpsideDown, 2) 15 self.assertEqual(CLDeviceOrientationLandscapeLeft, 3) 16 self.assertEqual(CLDeviceOrientationLandscapeRight, 4) 17 self.assertEqual(CLDeviceOrientationFaceUp, 5) 18 self.assertEqual(CLDeviceOrientationFaceDown, 6) 19 20 self.assertEqual(kCLAuthorizationStatusNotDetermined, 0) 21 self.assertEqual(kCLAuthorizationStatusRestricted, 1) 22 self.assertEqual(kCLAuthorizationStatusDenied, 2) 23 self.assertEqual(kCLAuthorizationStatusAuthorized, 3) 24 25 @min_os_level('10.7') 26 def testMethods10_7(self): 27 self.assertResultIsBOOL(CLLocationManager.locationServicesEnabled) 28 self.assertResultIsBOOL(CLLocationManager.headingAvailable) 29 self.assertResultIsBOOL(CLLocationManager.significantLocationChangeMonitoringAvailable) 30 self.assertResultIsBOOL(CLLocationManager.regionMonitoringAvailable) 31 self.assertResultIsBOOL(CLLocationManager.regionMonitoringEnabled) 32 33if __name__ == "__main__": 34 main() 35