telepathy-haze: tests: stop calling RequestChannel

Simon McVittie smcv at kemper.freedesktop.org
Tue Sep 24 04:14:09 PDT 2013


Module: telepathy-haze
Branch: master
Commit: 2703dff9a8969c5ec5fee369876f95c11493c170
URL:    http://cgit.freedesktop.org/telepathy/telepathy-haze/commit/?id=2703dff9a8969c5ec5fee369876f95c11493c170

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Sep 23 16:08:11 2013 +0100

tests: stop calling RequestChannel

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49389
Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>

---

 tests/twisted/text/destroy.py |   11 +++++++----
 tests/twisted/text/respawn.py |   11 +++++++----
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/tests/twisted/text/destroy.py b/tests/twisted/text/destroy.py
index 33b1de1..bb31c8f 100644
--- a/tests/twisted/text/destroy.py
+++ b/tests/twisted/text/destroy.py
@@ -17,11 +17,14 @@ 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'),
         )
 
@@ -33,7 +36,7 @@ def test(q, bus, conn, stream):
     assertLength(1, sig.args)
     assertLength(1, sig.args[0])        # one channel
     assertLength(2, sig.args[0][0])     # two struct members
-    assertEquals(ret.value[0], sig.args[0][0][0])
+    assertEquals(ret.value, sig.args[0][0])
     emitted_props = sig.args[0][0][1]
     assertEquals(cs.CHANNEL_TYPE_TEXT, emitted_props[cs.CHANNEL_TYPE])
     assertEquals(cs.HT_CONTACT, emitted_props[cs.TARGET_HANDLE_TYPE])
diff --git a/tests/twisted/text/respawn.py b/tests/twisted/text/respawn.py
index 6bcc059..170c331 100644
--- a/tests/twisted/text/respawn.py
+++ b/tests/twisted/text/respawn.py
@@ -16,11 +16,14 @@ 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'),
         )
 
@@ -31,7 +34,7 @@ def test(q, bus, conn, stream):
     assertLength(1, sig.args)
     assertLength(1, sig.args[0])        # one channel
     assertLength(2, sig.args[0][0])     # two struct members
-    assertEquals(ret.value[0], sig.args[0][0][0])
+    assertEquals(ret.value, sig.args[0][0])
     emitted_props = sig.args[0][0][1]
     assertEquals(cs.CHANNEL_TYPE_TEXT, emitted_props[cs.CHANNEL_TYPE])
     assertEquals(cs.HT_CONTACT, emitted_props[cs.TARGET_HANDLE_TYPE])



More information about the telepathy-commits mailing list