telepathy-gabble: stop using RequestChannel()

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Fri Oct 11 14:58:34 PDT 2013


Module: telepathy-gabble
Branch: master
Commit: da29c7cb84870bdaac607c84e51b075224866fcb
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=da29c7cb84870bdaac607c84e51b075224866fcb

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Thu Oct 10 12:16:27 2013 -0400

stop using RequestChannel()

---

 tests/twisted/test-debug.py    |   14 ++++++++++----
 tests/twisted/text/destroy.py  |    8 +++++---
 tests/twisted/text/initiate.py |    8 +++++---
 tests/twisted/text/respawn.py  |    8 +++++---
 4 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/tests/twisted/test-debug.py b/tests/twisted/test-debug.py
index 83bf1f7..d3662a5 100644
--- a/tests/twisted/test-debug.py
+++ b/tests/twisted/test-debug.py
@@ -34,8 +34,11 @@ def test(q, bus, conn, stream):
     assert debug.Properties.Get(cs.DEBUG_IFACE, 'Enabled') == False
     debug.Properties.Set(cs.DEBUG_IFACE, 'Enabled', True)
 
-    channel_path = conn.RequestChannel(
-        cs.CHANNEL_TYPE_TEXT, cs.HT_CONTACT, conn.Properties.Get(cs.CONN, "SelfHandle"), True)
+    channel_path, props = conn.Requests.CreateChannel({
+        cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT,
+        cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
+        cs.TARGET_HANDLE: conn.Properties.Get(cs.CONN, "SelfHandle")
+        })
     q.expect('dbus-signal', signal = 'NewDebugMessage')
 
     assert len(messages) > 0
@@ -50,8 +53,11 @@ def test(q, bus, conn, stream):
     channel.Close(dbus_interface=cs.CHANNEL)
     q.expect('dbus-signal', signal='Closed')
 
-    conn.RequestChannel(
-        cs.CHANNEL_TYPE_TEXT, cs.HT_CONTACT, conn.Properties.Get(cs.CONN, "SelfHandle"), True)
+    channel_path, props = conn.Requests.CreateChannel({
+        cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT,
+        cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
+        cs.TARGET_HANDLE: conn.Properties.Get(cs.CONN, "SelfHandle")
+        })
     q.expect('dbus-signal', signal='NewChannels')
 
     assertEquals (snapshot, messages)
diff --git a/tests/twisted/text/destroy.py b/tests/twisted/text/destroy.py
index da970a4..9b1f3d6 100644
--- a/tests/twisted/text/destroy.py
+++ b/tests/twisted/text/destroy.py
@@ -17,11 +17,13 @@ def test(q, bus, conn, stream):
     jid = 'foo at bar.com'
     foo_handle = conn.get_contact_handle_sync(jid)
 
-    call_async(q, conn, 'RequestChannel',
-        cs.CHANNEL_TYPE_TEXT, cs.HT_CONTACT, foo_handle, True)
+    call_async(q, conn.Requests, 'CreateChannel', {
+        cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT,
+        cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
+        cs.TARGET_HANDLE: foo_handle })
 
     ret, new_sig = q.expect_many(
-        EventPattern('dbus-return', method='RequestChannel'),
+        EventPattern('dbus-return', method='CreateChannel'),
         EventPattern('dbus-signal', signal='NewChannels'),
         )
 
diff --git a/tests/twisted/text/initiate.py b/tests/twisted/text/initiate.py
index 780bcc7..a237fc6 100644
--- a/tests/twisted/text/initiate.py
+++ b/tests/twisted/text/initiate.py
@@ -16,11 +16,13 @@ def test(q, bus, conn, stream):
     jid = 'foo at bar.com'
     foo_handle = conn.get_contact_handle_sync(jid)
 
-    call_async(q, conn, 'RequestChannel',
-        cs.CHANNEL_TYPE_TEXT, cs.HT_CONTACT, foo_handle, True)
+    call_async(q, conn.Requests, 'CreateChannel', {
+        cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT,
+        cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
+        cs.TARGET_HANDLE: foo_handle })
 
     ret, sig = q.expect_many(
-        EventPattern('dbus-return', method='RequestChannel'),
+        EventPattern('dbus-return', method='CreateChannel'),
         EventPattern('dbus-signal', signal='NewChannels'),
         )
 
diff --git a/tests/twisted/text/respawn.py b/tests/twisted/text/respawn.py
index 1d81084..0abc30f 100644
--- a/tests/twisted/text/respawn.py
+++ b/tests/twisted/text/respawn.py
@@ -16,11 +16,13 @@ def test(q, bus, conn, stream):
     jid = 'foo at bar.com'
     foo_handle = conn.get_contact_handle_sync(jid)
 
-    call_async(q, conn, 'RequestChannel',
-        cs.CHANNEL_TYPE_TEXT, cs.HT_CONTACT, foo_handle, True)
+    call_async(q, conn.Requests, 'CreateChannel', {
+        cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT,
+        cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
+        cs.TARGET_HANDLE: foo_handle })
 
     ret, new_sig = q.expect_many(
-        EventPattern('dbus-return', method='RequestChannel'),
+        EventPattern('dbus-return', method='CreateChannel'),
         EventPattern('dbus-signal', signal='NewChannels'),
         )
 



More information about the telepathy-commits mailing list