[telepathy-gabble/master] check that NewLocalConnection is fired

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed May 20 02:22:42 PDT 2009


---
 tests/twisted/tubes/accept-muc-stream-tube.py     |    2 +-
 tests/twisted/tubes/accept-private-stream-tube.py |    2 +-
 tests/twisted/tubes/tubetestutil.py               |   13 +++++++++----
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/twisted/tubes/accept-muc-stream-tube.py b/tests/twisted/tubes/accept-muc-stream-tube.py
index d3a134f..5bf2ea0 100644
--- a/tests/twisted/tubes/accept-muc-stream-tube.py
+++ b/tests/twisted/tubes/accept-muc-stream-tube.py
@@ -192,7 +192,7 @@ def test(q, bus, conn, stream, bytestream_cls,
 
     address = accept_return_event.value[0]
 
-    socket_event, si_event = t.connect_to_cm_socket(q, 'chat at conf.localhost/bob',
+    socket_event, si_event, conn_id = t.connect_to_cm_socket(q, 'chat at conf.localhost/bob',
         address_type, address, access_control, access_control_param)
 
     protocol = socket_event.protocol
diff --git a/tests/twisted/tubes/accept-private-stream-tube.py b/tests/twisted/tubes/accept-private-stream-tube.py
index 02b156d..a2adc1b 100644
--- a/tests/twisted/tubes/accept-private-stream-tube.py
+++ b/tests/twisted/tubes/accept-private-stream-tube.py
@@ -76,7 +76,7 @@ def receive_tube_offer(q, bus, conn, stream):
 def expect_tube_activity(q, bus, conn, stream, bytestream_cls, address_type,
     address, access_control, access_control_param):
 
-    event_socket, event_iq = t.connect_to_cm_socket(q, bob_jid,
+    event_socket, event_iq, conn_id = t.connect_to_cm_socket(q, bob_jid,
         address_type, address, access_control, access_control_param)
 
     protocol = event_socket.protocol
diff --git a/tests/twisted/tubes/tubetestutil.py b/tests/twisted/tubes/tubetestutil.py
index afc2210..2f42a62 100644
--- a/tests/twisted/tubes/tubetestutil.py
+++ b/tests/twisted/tubes/tubetestutil.py
@@ -329,15 +329,20 @@ def connect_to_cm_socket(q, to, address_type, address, access_control,
         socket_event.protocol.sendData('a')
 
         # once credentials have been sent, Gabble sends SI request
-        si_event = q.expect('stream-iq', to=to, query_ns=ns.SI, query_name='si')
+        si_event, sig = q.expect_many(
+            EventPattern('stream-iq', to=to, query_ns=ns.SI, query_name='si'),
+            EventPattern('dbus-signal', signal='NewLocalConnection'))
 
     else:
-        socket_event, si_event = q.expect_many(
+        socket_event, si_event, sig = q.expect_many(
             EventPattern('socket-connected'),
             # expect SI request
-            EventPattern('stream-iq', to=to, query_ns=ns.SI, query_name='si'))
+            EventPattern('stream-iq', to=to, query_ns=ns.SI, query_name='si'),
+            EventPattern('dbus-signal', signal='NewLocalConnection'))
 
-    return socket_event, si_event
+    connection_id = sig.args[0]
+    assert connection_id != 0
+    return socket_event, si_event, connection_id
 
 def exec_tube_test(test, *args):
     for bytestream_cls in [
-- 
1.5.6.5




More information about the telepathy-commits mailing list