1from PyObjCTools.TestSupport import * 2 3from Foundation import * 4 5try: 6 unicode 7except NameError: 8 unicode = str 9 10class TestNSHTTPCookie (TestCase): 11 def testConstants(self): 12 self.assertIsInstance(NSHTTPCookieName, unicode) 13 self.assertIsInstance(NSHTTPCookieValue, unicode) 14 self.assertIsInstance(NSHTTPCookieOriginURL, unicode) 15 self.assertIsInstance(NSHTTPCookieVersion, unicode) 16 self.assertIsInstance(NSHTTPCookieDomain, unicode) 17 self.assertIsInstance(NSHTTPCookiePath, unicode) 18 self.assertIsInstance(NSHTTPCookieSecure, unicode) 19 self.assertIsInstance(NSHTTPCookieExpires, unicode) 20 self.assertIsInstance(NSHTTPCookieComment, unicode) 21 self.assertIsInstance(NSHTTPCookieCommentURL, unicode) 22 self.assertIsInstance(NSHTTPCookieDiscard, unicode) 23 self.assertIsInstance(NSHTTPCookieMaximumAge, unicode) 24 self.assertIsInstance(NSHTTPCookiePort, unicode) 25 26 def testMethods(self): 27 self.assertResultIsBOOL(NSHTTPCookie.isSessionOnly) 28 self.assertResultIsBOOL(NSHTTPCookie.isSecure) 29 self.assertResultIsBOOL(NSHTTPCookie.isHTTPOnly) 30 31if __name__ == "__main__": 32 main() 33