1from PyObjCTools.TestSupport import * 2 3from Foundation import * 4 5 6class TestNSDistributedNotificationCenter (TestCase): 7 def testConstants(self): 8 self.failUnless(isinstance(NSLocalNotificationCenterType, unicode)) 9 10 self.assertEquals(NSNotificationSuspensionBehaviorDrop, 1) 11 self.assertEquals(NSNotificationSuspensionBehaviorCoalesce, 2) 12 self.assertEquals(NSNotificationSuspensionBehaviorHold, 3) 13 self.assertEquals(NSNotificationSuspensionBehaviorDeliverImmediately, 4) 14 15 self.assertEquals(NSNotificationDeliverImmediately, 1) 16 self.assertEquals(NSNotificationPostToAllSessions, 2) 17 18 def testMethods(self): 19 self.failUnlessArgIsSEL(NSDistributedNotificationCenter.addObserver_selector_name_object_suspensionBehavior_, 1, 'v@:@') 20 self.failUnlessArgIsSEL(NSDistributedNotificationCenter.addObserver_selector_name_object_, 1, 'v@:@') 21 22 self.failUnlessArgIsBOOL(NSDistributedNotificationCenter.postNotificationName_object_userInfo_deliverImmediately_, 3) 23 self.failUnlessArgIsBOOL(NSDistributedNotificationCenter.setSuspended_, 0) 24 self.failUnlessResultIsBOOL(NSDistributedNotificationCenter.suspended) 25 26if __name__ == "__main__": 27 main() 28