From 39d5cbac0a5c5185e26f552ba0ff46b5fed48a06 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 23 Sep 2013 16:08:11 +0100 Subject: [PATCH 16/16] tests: stop calling RequestChannel --- 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@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@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]) -- 1.8.4.rc3