[Telepathy-commits] [telepathy-gabble/master] offer-private-dbus-tube-ibb: move test function to the end of the file
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Mon Jan 26 07:05:14 PST 2009
---
tests/twisted/tubes/offer-private-dbus-tube-ibb.py | 53 ++++++++++----------
1 files changed, 26 insertions(+), 27 deletions(-)
diff --git a/tests/twisted/tubes/offer-private-dbus-tube-ibb.py b/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
index a026bcf..bb40610 100644
--- a/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
+++ b/tests/twisted/tubes/offer-private-dbus-tube-ibb.py
@@ -48,32 +48,6 @@ def make_caps_disco_reply(stream, req, features):
return iq
-def test(q, bus, conn, stream):
- conn.Connect()
-
- q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
-
- self_handle = conn.GetSelfHandle()
- alice_handle = conn.RequestHandles(HT_CONTACT, ["alice at localhost"])[0]
-
- # send Alice's presence
- caps = { 'ext': '', 'ver': '0.0.0',
- 'node': 'http://example.com/fake-client0' }
- presence = make_presence('alice at localhost/Test', 'test at localhost', caps)
- stream.send(presence)
-
- q.expect('dbus-signal', signal='PresencesChanged',
- args = [{alice_handle: (2L, u'available', u'')}])
-
- # reply to disco query
- event = q.expect('stream-iq', to='alice at localhost/Test', query_ns=DISCO_INFO)
- stream.send(make_caps_disco_reply(stream, event.stanza, [TUBES]))
-
- sync_stream(q, stream)
-
- offer_old_dbus_tube(q, bus, conn, stream, self_handle, alice_handle)
- offer_new_dbus_tube(q, bus, conn, stream, self_handle, alice_handle)
-
def alice_accepts_tube(q, stream, iq_event, dbus_tube_id):
iq = iq_event.stanza
@@ -329,9 +303,34 @@ def offer_new_dbus_tube(q, bus, conn, stream, self_handle, alice_handle):
sample_parameters, TUBE_STATE_REMOTE_PENDING)
check_tube_in_tubes(expected_tube, tubes)
+def test(q, bus, conn, stream):
+ conn.Connect()
+
+ q.expect('dbus-signal', signal='StatusChanged', args=[0, 1])
+
+ self_handle = conn.GetSelfHandle()
+ alice_handle = conn.RequestHandles(HT_CONTACT, ["alice at localhost"])[0]
+
+ # send Alice's presence
+ caps = { 'ext': '', 'ver': '0.0.0',
+ 'node': 'http://example.com/fake-client0' }
+ presence = make_presence('alice at localhost/Test', 'test at localhost', caps)
+ stream.send(presence)
+
+ q.expect('dbus-signal', signal='PresencesChanged',
+ args = [{alice_handle: (2L, u'available', u'')}])
+
+ # reply to disco query
+ event = q.expect('stream-iq', to='alice at localhost/Test', query_ns=DISCO_INFO)
+ stream.send(make_caps_disco_reply(stream, event.stanza, [TUBES]))
+
+ sync_stream(q, stream)
+
+ offer_old_dbus_tube(q, bus, conn, stream, self_handle, alice_handle)
+ offer_new_dbus_tube(q, bus, conn, stream, self_handle, alice_handle)
+
# OK, we're done
conn.Disconnect()
-
q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])
if __name__ == '__main__':
--
1.5.6.5
More information about the Telepathy-commits
mailing list