[Telepathy-commits] [telepathy-gabble/master] accept-private-stream-tube.py: use constants.py

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Mon Jan 26 07:52:45 PST 2009


---
 tests/twisted/tubes/accept-private-stream-tube.py |   22 +++++++-------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/tests/twisted/tubes/accept-private-stream-tube.py b/tests/twisted/tubes/accept-private-stream-tube.py
index 0a9fc4b..23ee2ad 100644
--- a/tests/twisted/tubes/accept-private-stream-tube.py
+++ b/tests/twisted/tubes/accept-private-stream-tube.py
@@ -10,13 +10,13 @@ Receives several tube offers:
 
 import dbus
 
-from servicetest import call_async, EventPattern, tp_name_prefix, \
-     EventProtocolClientFactory
+from servicetest import call_async, EventPattern, EventProtocolClientFactory
 from gabbletest import exec_test, acknowledge_iq, send_error_reply
 
 from twisted.words.xish import domish, xpath
 from twisted.internet import reactor
 import ns
+from constants import *
 
 bob_jid = 'bob at localhost/Bob'
 stream_tube_id = 49
@@ -36,10 +36,8 @@ def receive_tube_offer(q, bus, conn, stream):
         EventPattern('dbus-signal', signal='NewChannels'),
         )
     chan_path = old_sig.args[0]
-    assert old_sig.args[1] == \
-        'org.freedesktop.Telepathy.Channel.Type.Tubes', \
-        old_sig.args[1]
-    assert old_sig.args[2] == 1 # Handle_Type_Contact
+    assert old_sig.args[1] == CHANNEL_TYPE_TUBES, old_sig.args[1]
+    assert old_sig.args[2] == HT_CONTACT
     bob_handle = old_sig.args[3]
     assert old_sig.args[2] == 1, old_sig.args[2] # Suppress_Handler
     assert len(new_sig.args) == 1
@@ -55,10 +53,8 @@ def receive_tube_offer(q, bus, conn, stream):
         )
     new_chan_path = old_sig.args[0]
     assert new_chan_path != chan_path
-    assert old_sig.args[1] == \
-        'org.freedesktop.Telepathy.Channel.Type.StreamTube.DRAFT', \
-        old_sig.args[1]
-    assert old_sig.args[2] == 1 # Handle_Type_Contact
+    assert old_sig.args[1] == CHANNEL_TYPE_STREAM_TUBE, old_sig.args[1]
+    assert old_sig.args[2] == HT_CONTACT
     bob_handle = old_sig.args[3]
     assert old_sig.args[2] == 1, old_sig.args[2] # Suppress_Handler
     assert len(new_sig.args) == 1
@@ -68,12 +64,10 @@ def receive_tube_offer(q, bus, conn, stream):
 
     # create channel proxies
     tubes_chan = bus.get_object(conn.bus_name, chan_path)
-    tubes_iface = dbus.Interface(tubes_chan,
-            tp_name_prefix + '.Channel.Type.Tubes')
+    tubes_iface = dbus.Interface(tubes_chan, CHANNEL_TYPE_TUBES)
 
     new_tube_chan = bus.get_object(conn.bus_name, new_chan_path)
-    new_tube_iface = dbus.Interface(new_tube_chan,
-            tp_name_prefix + '.Channel.Type.StreamTube.DRAFT')
+    new_tube_iface = dbus.Interface(new_tube_chan, CHANNEL_TYPE_STREAM_TUBE)
 
     return (tubes_chan, tubes_iface, new_tube_chan, new_tube_iface)
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list