diff options
author | Marien Zwart <marienz@gentoo.org> | 2006-04-09 22:53:15 +0000 |
---|---|---|
committer | Marien Zwart <marienz@gentoo.org> | 2006-04-09 22:53:15 +0000 |
commit | 96dc2a81e07b1c932e02e3f214860f3c15d0270b (patch) | |
tree | ab5f9ce1dcc5b089c91fb2cdcbf916ef34f72aa4 /dev-python/twisted-web/files | |
parent | Fix dependency, see bug #128688. Thanks to nixnut for noticing. (diff) | |
download | historical-96dc2a81e07b1c932e02e3f214860f3c15d0270b.tar.gz historical-96dc2a81e07b1c932e02e3f214860f3c15d0270b.tar.bz2 historical-96dc2a81e07b1c932e02e3f214860f3c15d0270b.zip |
Revision bump with patches to pass the tests with twisted-2.2.0. Test changes only. See bug #128688. Thanks to nixnut for noticing.
Package-Manager: portage-2.1_pre7-r5
Diffstat (limited to 'dev-python/twisted-web/files')
4 files changed, 210 insertions, 0 deletions
diff --git a/dev-python/twisted-web/files/digest-twisted-web-0.5.0-r2 b/dev-python/twisted-web/files/digest-twisted-web-0.5.0-r2 new file mode 100644 index 000000000000..58850c744dfb --- /dev/null +++ b/dev-python/twisted-web/files/digest-twisted-web-0.5.0-r2 @@ -0,0 +1,3 @@ +MD5 287b9402ca99d05e6d3be99413317633 TwistedWeb-0.5.0.tar.bz2 263139 +RMD160 61829c8ae492c7cf3f43f45c70a5653584e50378 TwistedWeb-0.5.0.tar.bz2 263139 +SHA256 7d33de4924c0f7819b3ba9980461ca2bf7b8f5619f21f90755c29255570b599e TwistedWeb-0.5.0.tar.bz2 263139 diff --git a/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14780.patch b/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14780.patch new file mode 100644 index 000000000000..3c5a36d4fcc3 --- /dev/null +++ b/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14780.patch @@ -0,0 +1,109 @@ +Index: twisted/web/test/test_xmlrpc.py +=================================================================== +--- twisted/web/test/test_xmlrpc.py (revision 14779) ++++ twisted/web/test/test_xmlrpc.py (revision 14780) +@@ -96,18 +96,20 @@ + return xmlrpc.Proxy("http://127.0.0.1:%d/" % self.port) + + def testResults(self): +- x = self.proxy().callRemote("add", 2, 3) +- self.assertEquals(unittest.deferredResult(x), 5) +- x = self.proxy().callRemote("defer", "a") +- self.assertEquals(unittest.deferredResult(x), "a") +- x = self.proxy().callRemote("dict", {"a" : 1}, "a") +- self.assertEquals(unittest.deferredResult(x), 1) +- x = self.proxy().callRemote("pair", 'a', 1) +- self.assertEquals(unittest.deferredResult(x), ['a', 1]) +- x = self.proxy().callRemote("complex") +- self.assertEquals(unittest.deferredResult(x), +- {"a": ["b", "c", 12, []], "D": "foo"}) ++ inputOutput = [ ++ ("add", (2, 3), 5), ++ ("defer", ("a",), "a"), ++ ("dict", ({"a": 1}, "a"), 1), ++ ("pair", ("a", 1), ["a", 1]), ++ ("complex", (), {"a": ["b", "c", 12, []], "D": "foo"})] + ++ dl = [] ++ for meth, args, outp in inputOutput: ++ d = self.proxy().callRemote(meth, *args) ++ d.addCallback(self.assertEquals, outp) ++ dl.append(d) ++ return defer.DeferredList(dl) ++ + def testErrors(self): + for code, methodName in [(666, "fail"), (666, "deferFail"), + (12, "fault"), (23, "noSuchMethod"), +@@ -140,38 +142,44 @@ + self.port = self.p.getHost().port + + def testListMethods(self): ++ ++ def cbMethods(meths): ++ meths.sort() ++ self.failUnlessEqual( ++ meths, ++ ['add', 'complex', 'defer', 'deferFail', ++ 'deferFault', 'dict', 'fail', 'fault', ++ 'pair', 'system.listMethods', ++ 'system.methodHelp', ++ 'system.methodSignature']) ++ + d = self.proxy().callRemote("system.listMethods") +- list = unittest.deferredResult(d) +- list.sort() +- self.failUnlessEqual(list, ['add', 'complex', 'defer', 'deferFail', +- 'deferFault', 'dict', 'fail', 'fault', +- 'pair', 'system.listMethods', +- 'system.methodHelp', +- 'system.methodSignature']) ++ d.addCallback(cbMethods) ++ return d + + def testMethodHelp(self): +- d = self.proxy().callRemote("system.methodHelp", 'defer') +- help = unittest.deferredResult(d) +- self.failUnlessEqual(help, 'Help for defer.') ++ inputOutputs = [ ++ ("defer", "Help for defer."), ++ ("fail", ""), ++ ("dict", "Help for dict.")] + +- d = self.proxy().callRemote("system.methodHelp", 'fail') +- help = unittest.deferredResult(d) +- self.failUnlessEqual(help, '') ++ dl = [] ++ for meth, expected in inputOutputs: ++ d = self.proxy().callRemote("system.methodHelp", meth) ++ d.addCallback(self.assertEquals, expected) ++ dl.append(d) ++ return defer.DeferredList(dl) + +- d = self.proxy().callRemote("system.methodHelp", 'dict') +- help = unittest.deferredResult(d) +- self.failUnlessEqual(help, 'Help for dict.') +- + def testMethodSignature(self): +- d = self.proxy().callRemote("system.methodSignature", 'defer') +- sig = unittest.deferredResult(d) +- self.failUnlessEqual(sig, '') ++ inputOutputs = [ ++ ("defer", ""), ++ ("add", [['int', 'int', 'int'], ++ ['double', 'double', 'double']]), ++ ("pair", [['array', 'string', 'int']])] + +- d = self.proxy().callRemote("system.methodSignature", 'add') +- sig = unittest.deferredResult(d) +- self.failUnlessEqual(sig, [['int', 'int', 'int'], +- ['double', 'double', 'double']]) +- +- d = self.proxy().callRemote("system.methodSignature", 'pair') +- sig = unittest.deferredResult(d) +- self.failUnlessEqual(sig, [['array', 'string', 'int']]) ++ dl = [] ++ for meth, expected in inputOutputs: ++ d = self.proxy().callRemote("system.methodSignature", meth) ++ d.addCallback(self.assertEquals, expected) ++ dl.append(d) ++ return defer.DeferredList(dl) diff --git a/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14782.patch b/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14782.patch new file mode 100644 index 000000000000..4c19296e5f3b --- /dev/null +++ b/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14782.patch @@ -0,0 +1,39 @@ +Index: twisted/web/test/test_xmlrpc.py +=================================================================== +--- twisted/web/test/test_xmlrpc.py (revision 14781) ++++ twisted/web/test/test_xmlrpc.py (revision 14782) +@@ -88,9 +88,7 @@ + self.port = self.p.getHost().port + + def tearDown(self): +- self.p.stopListening() +- reactor.iterate() +- reactor.iterate() ++ return self.p.stopListening() + + def proxy(self): + return xmlrpc.Proxy("http://127.0.0.1:%d/" % self.port) +@@ -108,7 +106,7 @@ + d = self.proxy().callRemote(meth, *args) + d.addCallback(self.assertEquals, outp) + dl.append(d) +- return defer.DeferredList(dl) ++ return defer.DeferredList(dl, fireOnOneErrback=True) + + def testErrors(self): + for code, methodName in [(666, "fail"), (666, "deferFail"), +@@ -168,7 +166,7 @@ + d = self.proxy().callRemote("system.methodHelp", meth) + d.addCallback(self.assertEquals, expected) + dl.append(d) +- return defer.DeferredList(dl) ++ return defer.DeferredList(dl, fireOnOneErrback=True) + + def testMethodSignature(self): + inputOutputs = [ +@@ -182,4 +180,4 @@ + d = self.proxy().callRemote("system.methodSignature", meth) + d.addCallback(self.assertEquals, expected) + dl.append(d) +- return defer.DeferredList(dl) ++ return defer.DeferredList(dl, fireOnOneErrback=True) diff --git a/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14786.patch b/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14786.patch new file mode 100644 index 000000000000..c3da66ff722d --- /dev/null +++ b/dev-python/twisted-web/files/twisted-web-0.5.0-tests-2.2-compat-14786.patch @@ -0,0 +1,59 @@ +Index: twisted/web/test/test_xmlrpc.py +=================================================================== +--- twisted/web/test/test_xmlrpc.py (revision 14785) ++++ twisted/web/test/test_xmlrpc.py (revision 14786) +@@ -23,6 +23,12 @@ + + import time + ++class TestRuntimeError(RuntimeError): ++ pass ++ ++class TestValueError(ValueError): ++ pass ++ + class Test(XMLRPC): + + FAILURE = 666 +@@ -50,11 +56,11 @@ + return defer.succeed(x) + + def xmlrpc_deferFail(self): +- return defer.fail(ValueError()) ++ return defer.fail(TestValueError()) + + # don't add a doc string, it's part of the test + def xmlrpc_fail(self): +- raise RuntimeError ++ raise TestRuntimeError + + def xmlrpc_fault(self): + return xmlrpc.Fault(12, "hello") +@@ -109,19 +115,17 @@ + return defer.DeferredList(dl, fireOnOneErrback=True) + + def testErrors(self): ++ dl = [] + for code, methodName in [(666, "fail"), (666, "deferFail"), + (12, "fault"), (23, "noSuchMethod"), + (17, "deferFault"), (42, "SESSION_TEST")]: +- l = [] +- d = self.proxy().callRemote(methodName).addErrback(l.append) +- timeout = time.time() + 10 +- while not l and time.time() < timeout: +- reactor.iterate(0.01) +- if not l: +- self.fail("timeout") +- l[0].trap(xmlrpc.Fault) +- self.assertEquals(l[0].value.faultCode, code) +- log.flushErrors(RuntimeError, ValueError) ++ d = self.proxy().callRemote(methodName) ++ d = self.assertFailure(d, xmlrpc.Fault) ++ d.addCallback(lambda exc, code=code: self.assertEquals(exc.faultCode, code)) ++ dl.append(d) ++ d = defer.DeferredList(dl, fireOnOneErrback=True) ++ d.addCallback(lambda ign: log.flushErrors(TestRuntimeError, TestValueError)) ++ return d + + + class XMLRPCTestCase2(XMLRPCTestCase): |