diff options
Diffstat (limited to 'tests/twisted/text/destroy.py')
-rw-r--r-- | tests/twisted/text/destroy.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/tests/twisted/text/destroy.py b/tests/twisted/text/destroy.py index aac3f94..4c495bb 100644 --- a/tests/twisted/text/destroy.py +++ b/tests/twisted/text/destroy.py @@ -8,7 +8,7 @@ import dbus from twisted.words.xish import domish from hazetest import exec_test -from servicetest import call_async, EventPattern, assertEquals +from servicetest import call_async, EventPattern, assertEquals, assertLength import constants as cs def test(q, bus, conn, stream): @@ -20,9 +20,8 @@ def test(q, bus, conn, stream): call_async(q, conn, 'RequestChannel', 'org.freedesktop.Telepathy.Channel.Type.Text', 1, foo_handle, True) - ret, old_sig, new_sig = q.expect_many( + ret, sig = q.expect_many( EventPattern('dbus-return', method='RequestChannel'), - EventPattern('dbus-signal', signal='NewChannel'), EventPattern('dbus-signal', signal='NewChannels'), ) @@ -34,18 +33,11 @@ def test(q, bus, conn, stream): destroyable_iface = dbus.Interface(text_chan, 'org.freedesktop.Telepathy.Channel.Interface.Destroyable') - assert old_sig.args[0] == ret.value[0] - assert old_sig.args[1] == u'org.freedesktop.Telepathy.Channel.Type.Text' - # check that handle type == contact handle - assert old_sig.args[2] == 1 - 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 - assert new_sig.args[0][0][0] == ret.value[0] - emitted_props = new_sig.args[0][0][1] + 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]) + emitted_props = sig.args[0][0][1] assert emitted_props['org.freedesktop.Telepathy.Channel.ChannelType'] ==\ 'org.freedesktop.Telepathy.Channel.Type.Text' assert emitted_props['org.freedesktop.Telepathy.Channel.' |