diff -ur CherryPy-2.2.1/cherrypy/test/test_core.py CherryPy-2.2.1-py2.5/cherrypy/test/test_core.py --- CherryPy-2.2.1/cherrypy/test/test_core.py 2006-04-25 04:37:40.000000000 +0300 +++ CherryPy-2.2.1-py2.5/cherrypy/test/test_core.py 2008-01-08 23:37:55.000000000 +0200 @@ -824,15 +824,27 @@ self.assertBody(data) def testCookies(self): - self.getPage("/cookies/single?name=First", + import sys + if sys.version_info >= (2, 5): + self.getPage("/cookies/single?name=First", + [('Cookie', 'First=Dinsdale;')]) + self.assertHeader('Set-Cookie', 'First=Dinsdale') + + self.getPage("/cookies/multiple?names=First&names=Last", + [('Cookie', 'First=Dinsdale; Last=Piranha;'), + ]) + self.assertHeader('Set-Cookie', 'First=Dinsdale') + self.assertHeader('Set-Cookie', 'Last=Piranha') + else: + self.getPage("/cookies/single?name=First", [('Cookie', 'First=Dinsdale;')]) - self.assertHeader('Set-Cookie', 'First=Dinsdale;') + self.assertHeader('Set-Cookie', 'First=Dinsdale;') - self.getPage("/cookies/multiple?names=First&names=Last", + self.getPage("/cookies/multiple?names=First&names=Last", [('Cookie', 'First=Dinsdale; Last=Piranha;'), ]) - self.assertHeader('Set-Cookie', 'First=Dinsdale;') - self.assertHeader('Set-Cookie', 'Last=Piranha;') + self.assertHeader('Set-Cookie', 'First=Dinsdale;') + self.assertHeader('Set-Cookie', 'Last=Piranha;') def testMaxRequestSize(self): self.getPage("/", headers=[('From', "x" * 500)]) diff -ur CherryPy-2.2.1/cherrypy/test/webtest.py CherryPy-2.2.1-py2.5/cherrypy/test/webtest.py --- CherryPy-2.2.1/cherrypy/test/webtest.py 2006-04-25 04:37:40.000000000 +0300 +++ CherryPy-2.2.1-py2.5/cherrypy/test/webtest.py 2008-01-08 23:58:51.000000000 +0200 @@ -204,43 +204,81 @@ def exit(self): sys.exit() - def __call__(self, result=None): - if result is None: - result = self.defaultTestResult() - result.startTest(self) - testMethod = getattr(self, self._TestCase__testMethodName) - try: - try: - self.setUp() - except (KeyboardInterrupt, SystemExit): - raise - except: - result.addError(self, self._TestCase__exc_info()) - return - - ok = 0 + if sys.version_info >= (2, 5): + def __call__(self, result=None): + if result is None: + result = self.defaultTestResult() + result.startTest(self) + testMethod = getattr(self, self._testMethodName) try: - testMethod() - ok = 1 - except self.failureException: - result.addFailure(self, self._TestCase__exc_info()) - except (KeyboardInterrupt, SystemExit): - raise - except: - result.addError(self, self._TestCase__exc_info()) - + try: + self.setUp() + except (KeyboardInterrupt, SystemExit): + raise + except: + result.addError(self, self._exc_info()) + return + + ok = 0 + try: + testMethod() + ok = 1 + except self.failureException: + result.addFailure(self, self._exc_info()) + except (KeyboardInterrupt, SystemExit): + raise + except: + result.addError(self, self._exc_info()) + + try: + self.tearDown() + except (KeyboardInterrupt, SystemExit): + raise + except: + result.addError(self, self._exc_info()) + ok = 0 + if ok: + result.addSuccess(self) + finally: + result.stopTest(self) + else: + def __call__(self, result=None): + if result is None: + result = self.defaultTestResult() + result.startTest(self) + testMethod = getattr(self, self._TestCase__testMethodName) try: - self.tearDown() - except (KeyboardInterrupt, SystemExit): - raise - except: - result.addError(self, self._TestCase__exc_info()) + try: + self.setUp() + except (KeyboardInterrupt, SystemExit): + raise + except: + result.addError(self, self._TestCase__exc_info()) + return + ok = 0 - if ok: - result.addSuccess(self) - finally: - result.stopTest(self) - + try: + testMethod() + ok = 1 + except self.failureException: + result.addFailure(self, self._TestCase__exc_info()) + except (KeyboardInterrupt, SystemExit): + raise + except: + result.addError(self, self._TestCase__exc_info()) + + try: + self.tearDown() + except (KeyboardInterrupt, SystemExit): + raise + except: + result.addError(self, self._TestCase__exc_info()) + ok = 0 + if ok: + result.addSuccess(self) + finally: + result.stopTest(self) + def assertStatus(self, status, msg=None): """Fail if self.status != status.""" if isinstance(status, basestring):