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

Unified Diff: third_party/twisted_8_1/twisted/test/proto_helpers.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/proto_helpers.py
diff --git a/third_party/twisted_8_1/twisted/test/proto_helpers.py b/third_party/twisted_8_1/twisted/test/proto_helpers.py
deleted file mode 100644
index c0bd3de665d9fb9c6cda1abe16788a6994a0dde5..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/test/proto_helpers.py
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-
-from twisted.protocols import basic
-from twisted.internet import error
-
-
-class LineSendingProtocol(basic.LineReceiver):
- lostConn = False
-
- def __init__(self, lines, start = True):
- self.lines = lines[:]
- self.response = []
- self.start = start
-
- def connectionMade(self):
- if self.start:
- map(self.sendLine, self.lines)
-
- def lineReceived(self, line):
- if not self.start:
- map(self.sendLine, self.lines)
- self.lines = []
- self.response.append(line)
-
- def connectionLost(self, reason):
- self.lostConn = True
-
-
-class FakeDatagramTransport:
- noAddr = object()
-
- def __init__(self):
- self.written = []
-
- def write(self, packet, addr=noAddr):
- self.written.append((packet, addr))
-
-
-class StringTransport:
- disconnecting = 0
-
- hostAddr = None
- peerAddr = None
-
- def __init__(self, hostAddress=None, peerAddress=None):
- self.clear()
- if hostAddress is not None:
- self.hostAddr = hostAddress
- if peerAddress is not None:
- self.peerAddr = peerAddress
- self.connected = True
-
- def clear(self):
- self.io = StringIO()
-
- def value(self):
- return self.io.getvalue()
-
- def write(self, data):
- if isinstance(data, unicode): # no, really, I mean it
- raise TypeError("Data must not be unicode")
- self.io.write(data)
-
- def writeSequence(self, data):
- self.io.write(''.join(data))
-
- def loseConnection(self):
- pass
-
- def getPeer(self):
- if self.peerAddr is None:
- return ('StringIO', repr(self.io))
- return self.peerAddr
-
- def getHost(self):
- if self.hostAddr is None:
- return ('StringIO', repr(self.io))
- return self.hostAddr
-
-
-class StringTransportWithDisconnection(StringTransport):
- def loseConnection(self):
- if self.connected:
- self.connected = False
- self.protocol.connectionLost(error.ConnectionDone("Bye."))
-
« no previous file with comments | « third_party/twisted_8_1/twisted/test/process_twisted.py ('k') | third_party/twisted_8_1/twisted/test/raiser.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698