1from PyObjCTools.TestSupport import * 2 3import AppKit 4 5try: 6 unicode 7except NameError: 8 unicode = str 9 10class RestorationHelper (AppKit.NSObject): 11 def restoreWindowWithIdentifier_state_completionHandler_(self, a, b, c): pass 12 13 14class TestNSWindowRestoration (TestCase): 15 @min_os_level('10.7') 16 @expectedFailure 17 def testProtocol10_7(self): 18 self.assertArgIsBlock(RestorationHelper.restoreWindowWithIdentifier_state_completionHandler_, 2, b'v@@') 19 20 @min_os_level('10.7') 21 def testMethods10_7(self): 22 self.assertResultIsBOOL(AppKit.NSApplication.restoreWindowWithIdentifier_state_completionHandler_) 23 self.assertArgIsBlock(AppKit.NSApplication.restoreWindowWithIdentifier_state_completionHandler_, 2, b'v@@') 24 25 self.assertArgIsBOOL(AppKit.NSWindow.setRestorable_, 0) 26 self.assertResultIsBOOL(AppKit.NSWindow.isRestorable) 27 28 self.assertArgIsBlock(AppKit.NSDocument.restoreDocumentWindowWithIdentifier_state_completionHandler_, 2, b'v@@') 29 30 @min_os_level('10.7') 31 def testConstants10_7(self): 32 self.assertIsInstance(AppKit.NSApplicationDidFinishRestoringWindowsNotification,unicode) 33 34if __name__ == "__main__": 35 main() 36