summaryrefslogtreecommitdiff
path: root/tests/twisted/channels/requests-create.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/twisted/channels/requests-create.py')
-rw-r--r--tests/twisted/channels/requests-create.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/tests/twisted/channels/requests-create.py b/tests/twisted/channels/requests-create.py
index e3adb64..957560e 100644
--- a/tests/twisted/channels/requests-create.py
+++ b/tests/twisted/channels/requests-create.py
@@ -15,14 +15,12 @@ def test(q, bus, conn, stream):
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged', args=[0,1])
- ifs = conn.GetInterfaces()
+ props = conn.GetAll(cs.CONN, dbus_interface=cs.PROPERTIES_IFACE)
- assert cs.CONN_IFACE_REQUESTS in ifs
+ assertContains(cs.CONN_IFACE_REQUESTS, props['Interfaces'])
nick = 'foo'
- call_async(q, conn, 'RequestHandles', cs.HT_CONTACT, [nick])
- event = q.expect('dbus-return', method='RequestHandles')
- foo_handle = event.value[0][0]
+ foo_handle = conn.get_contact_handle_sync(nick)
properties = conn.GetAll(cs.CONN_IFACE_REQUESTS,
dbus_interface=cs.PROPERTIES_IFACE)
@@ -41,9 +39,8 @@ def test(q, bus, conn, stream):
}
call_async(q, requestotron, 'CreateChannel', request)
- ret, old_sig, new_sig = q.expect_many(
+ ret, new_sig = q.expect_many(
EventPattern('dbus-return', method='CreateChannel'),
- EventPattern('dbus-signal', signal='NewChannel'),
EventPattern('dbus-signal', signal='NewChannels'),
)
@@ -54,15 +51,9 @@ def test(q, bus, conn, stream):
assert emitted_props[cs.TARGET_HANDLE] == foo_handle
assert emitted_props[cs.TARGET_ID] == nick
assert emitted_props[cs.REQUESTED]
- assert emitted_props[cs.INITIATOR_HANDLE] == conn.GetSelfHandle()
+ assert emitted_props[cs.INITIATOR_HANDLE] == props['SelfHandle']
assert emitted_props[cs.INITIATOR_ID] == stream.nick
- assert old_sig.args[0] == ret.value[0]
- assert old_sig.args[1] == cs.CHANNEL_TYPE_TEXT
- assert old_sig.args[2] == cs.HT_CONTACT
- assert old_sig.args[3] == foo_handle
- assert old_sig.args[4] == True # suppress handler
-
assert len(new_sig.args) == 1
assert len(new_sig.args[0]) == 1 # one channel
assert len(new_sig.args[0][0]) == 2 # two struct members