Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: third_party/twisted_8_1/twisted/web/test/test_distrib.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/web/test/test_distrib.py
diff --git a/third_party/twisted_8_1/twisted/web/test/test_distrib.py b/third_party/twisted_8_1/twisted/web/test/test_distrib.py
deleted file mode 100644
index 152b3f3f99a267a137388d3fc1e3b81e3c8af0a6..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/web/test/test_distrib.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright (c) 2008 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-"""
-Tests for L{twisted.web.distrib}.
-"""
-
-from twisted.trial import unittest
-from twisted.web import http, distrib, client, resource, static, server
-from twisted.internet import reactor, defer
-from twisted.spread import pb
-from twisted.python import log
-
-class MySite(server.Site):
- def stopFactory(self):
- if hasattr(self, "logFile"):
- if self.logFile != log.logfile:
- self.logFile.close()
- del self.logFile
-
-
-class PBServerFactory(pb.PBServerFactory):
- def buildProtocol(self, addr):
- self.proto = pb.PBServerFactory.buildProtocol(self, addr)
- return self.proto
-
-
-class DistribTest(unittest.TestCase):
- port1 = None
- port2 = None
- sub = None
-
- def tearDown(self):
- dl = [defer.Deferred(), defer.Deferred()]
- self.f1.proto.notifyOnDisconnect(lambda: dl[0].callback(None))
- if self.sub is not None:
- self.sub.publisher.broker.notifyOnDisconnect(
- lambda: dl[1].callback(None))
- self.sub.publisher.broker.transport.loseConnection()
- http._logDateTimeStop()
- if self.port1 is not None:
- dl.append(self.port1.stopListening())
- if self.port2 is not None:
- dl.append(self.port2.stopListening())
- return defer.gatherResults(dl)
-
- def testDistrib(self):
- # site1 is the publisher
- r1 = resource.Resource()
- r1.putChild("there", static.Data("root", "text/plain"))
- site1 = server.Site(r1)
- self.f1 = PBServerFactory(distrib.ResourcePublisher(site1))
- self.port1 = reactor.listenTCP(0, self.f1)
- self.sub = distrib.ResourceSubscription("127.0.0.1",
- self.port1.getHost().port)
- r2 = resource.Resource()
- r2.putChild("here", self.sub)
- f2 = MySite(r2)
- self.port2 = reactor.listenTCP(0, f2)
- d = client.getPage("http://127.0.0.1:%d/here/there" % \
- self.port2.getHost().port)
- d.addCallback(self.failUnlessEqual, 'root')
- return d
-
« no previous file with comments | « third_party/twisted_8_1/twisted/web/test/test_cgi.py ('k') | third_party/twisted_8_1/twisted/web/test/test_domhelpers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698