[telepathy-gabble/master] add echoed attribute to Echo so tests can disable echoing if needed

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu May 7 07:14:31 PDT 2009


---
 tests/twisted/tubes/tubetestutil.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py
index 3fb6142..0b2ae65 100644
--- a/tests/twisted/tubes/tubetestutil.py
+++ b/tests/twisted/tubes/tubetestutil.py
@@ -207,10 +207,16 @@ class Echo(EventProtocol):
     """
     A trivial protocol that just echoes back whatever you send it, in lowercase.
     """
+    def __init__(self, queue=None, block_reading=False):
+        EventProtocol.__init__(self, queue, block_reading)
+
+        self.echoed = True
+
     def dataReceived(self, data):
         EventProtocol.dataReceived(self, data)
 
-        self.transport.write(data.lower())
+        if self.echoed:
+            self.transport.write(data.lower())
 
 class EchoFactory(EventProtocolFactory):
     def _create_protocol(self):
-- 
1.5.6.5




More information about the telepathy-commits mailing list