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

Unified Diff: third_party/twisted_8_1/twisted/test/testutils.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/test/testutils.py
diff --git a/third_party/twisted_8_1/twisted/test/testutils.py b/third_party/twisted_8_1/twisted/test/testutils.py
deleted file mode 100644
index a310ea2128f426d2d7cd2bf4cab8343cde294060..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/test/testutils.py
+++ /dev/null
@@ -1,55 +0,0 @@
-from cStringIO import StringIO
-from twisted.internet.protocol import FileWrapper
-
-class IOPump:
- """Utility to pump data between clients and servers for protocol testing.
-
- Perhaps this is a utility worthy of being in protocol.py?
- """
- def __init__(self, client, server, clientIO, serverIO):
- self.client = client
- self.server = server
- self.clientIO = clientIO
- self.serverIO = serverIO
-
- def flush(self):
- "Pump until there is no more input or output."
- while self.pump():
- pass
-
- def pump(self):
- """Move data back and forth.
-
- Returns whether any data was moved.
- """
- self.clientIO.seek(0)
- self.serverIO.seek(0)
- cData = self.clientIO.read()
- sData = self.serverIO.read()
- self.clientIO.seek(0)
- self.serverIO.seek(0)
- self.clientIO.truncate()
- self.serverIO.truncate()
- for byte in cData:
- self.server.dataReceived(byte)
- for byte in sData:
- self.client.dataReceived(byte)
- if cData or sData:
- return 1
- else:
- return 0
-
-
-def returnConnected(server, client):
- """Take two Protocol instances and connect them.
- """
- cio = StringIO()
- sio = StringIO()
- client.makeConnection(FileWrapper(cio))
- server.makeConnection(FileWrapper(sio))
- pump = IOPump(client, server, cio, sio)
- # Challenge-response authentication:
- pump.flush()
- # Uh...
- pump.flush()
- return pump
« no previous file with comments | « third_party/twisted_8_1/twisted/test/test_zshcomp.py ('k') | third_party/twisted_8_1/twisted/test/threading_latency.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698