[Pkg-telepathy-commits] [telepathy-mission-control-6] 151/280: Approver is now singular

Simon McVittie smcv at debian.org
Thu Mar 27 20:07:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.

commit 90acb0012361a8a4f912bf887e53ce59241acd41
Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Wed Jan 22 14:54:05 2014 +0100

    Approver is now singular
---
 src/mcd-dispatch-operation.c                       | 75 ++++++++++------------
 src/mcd-dispatcher.c                               |  4 ++
 tests/twisted/dispatcher/already-has-channel.py    |  3 +-
 tests/twisted/dispatcher/approver-fails.py         |  9 ++-
 tests/twisted/dispatcher/bypass-approval.py        |  5 +-
 tests/twisted/dispatcher/capture-bundle.py         |  3 +-
 tests/twisted/dispatcher/cdo-claim.py              |  2 +-
 tests/twisted/dispatcher/dispatch-activatable.py   |  6 +-
 tests/twisted/dispatcher/dispatch-text.py          | 19 +++---
 tests/twisted/dispatcher/ensure-is-approval.py     |  9 ++-
 tests/twisted/dispatcher/exploding-bundles.py      | 29 ++++-----
 tests/twisted/dispatcher/handle-channels-fails.py  |  9 ++-
 tests/twisted/dispatcher/lose-text.py              |  8 +--
 .../twisted/dispatcher/recover-from-disconnect.py  |  9 ++-
 tests/twisted/dispatcher/redispatch-channels.py    |  2 +-
 .../dispatcher/respawn-activatable-observers.py    |  9 ++-
 tests/twisted/dispatcher/respawn-observers.py      | 16 ++---
 17 files changed, 99 insertions(+), 118 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index d9a832e..3bc3ae7 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -711,23 +711,30 @@ get_account (TpSvcDBusProperties *self, const gchar *name, GValue *value)
 }
 
 static void
-get_channels (TpSvcDBusProperties *iface, const gchar *name, GValue *value)
+get_channel (TpSvcDBusProperties *iface, const gchar *name, GValue *value)
 {
     McdDispatchOperation *self = MCD_DISPATCH_OPERATION (iface);
 
     DEBUG ("called for %s", self->priv->unique_name);
 
-    g_value_init (value, TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST);
+    g_value_init (value, DBUS_TYPE_G_OBJECT_PATH);
+    g_value_set_boxed (value,
+        mcd_channel_get_object_path (self->priv->channel));
+}
 
-    if (self->priv->channel == NULL)
-    {
-        g_value_take_boxed (value, g_ptr_array_sized_new (0));
-        return;
-    }
+static void
+get_channel_properties (TpSvcDBusProperties *iface, const gchar *name,
+                        GValue *value)
+{
+    McdDispatchOperation *self = MCD_DISPATCH_OPERATION (iface);
+    GHashTable *props;
+
+    DEBUG ("called for %s", self->priv->unique_name);
 
-    g_value_take_boxed (value,
-        _mcd_tp_channel_details_build_from_tp_chan (
-            mcd_channel_get_tp_channel (self->priv->channel)));
+    props = mcd_channel_dup_immutable_properties_asv (self->priv->channel);
+
+    g_value_init (value, TP_HASH_TYPE_STRING_VARIANT_MAP);
+    g_value_take_boxed (value, props);
 }
 
 static void
@@ -746,7 +753,8 @@ static const McdDBusProp dispatch_operation_properties[] = {
     { "Interfaces", NULL, mcd_dbus_get_interfaces },
     { "Connection", NULL, get_connection },
     { "Account", NULL, get_account },
-    { "Channels", NULL, get_channels },
+    { "Channel", NULL, get_channel },
+    { "ChannelProperties", NULL, get_channel_properties },
     { "PossibleHandlers", NULL, get_possible_handlers },
     { 0 },
 };
@@ -788,7 +796,20 @@ mcd_dispatch_operation_actually_finish (McdDispatchOperation *self)
     g_object_ref (self);
 
     DEBUG ("%s/%p: finished", self->priv->unique_name, self);
-    tp_svc_channel_dispatch_operation_emit_finished (self);
+    if (self->priv->result == NULL)
+    {
+        tp_svc_channel_dispatch_operation_emit_finished (self, "", "");
+    }
+    else
+    {
+        gchar *error_name = _mcd_build_error_string (self->priv->result);
+
+        tp_svc_channel_dispatch_operation_emit_finished (self,
+                                                         error_name,
+                                                         self->priv->result->message);
+
+        g_free (error_name);
+    }
 
     _mcd_dispatch_operation_check_client_locks (self);
 
@@ -1488,10 +1509,6 @@ _mcd_dispatch_operation_get_properties (McdDispatchOperation *operation)
 
             if (!property->getprop) continue;
 
-            /* The Channels property is mutable, so cannot be returned
-             * here */
-            if (!tp_strdiff (property->name, "Channels")) continue;
-
             value = g_slice_new0 (GValue);
             property->getprop ((TpSvcDBusProperties *)operation,
                                property->name, value);
@@ -1635,18 +1652,6 @@ _mcd_dispatch_operation_lose_channel (McdDispatchOperation *self,
         g_assert (self->priv->lost_channel == NULL);
         self->priv->lost_channel = g_object_ref (channel);
     }
-    else
-    {
-        gchar *error_name = _mcd_build_error_string (error);
-
-        DEBUG ("%s/%p losing channel %s: %s: %s",
-               self->priv->unique_name, self, object_path, error_name,
-               error->message);
-        tp_svc_channel_dispatch_operation_emit_channel_lost (self, object_path,
-                                                             error_name,
-                                                             error->message);
-        g_free (error_name);
-    }
 
     /* We previously stole this ref from self->priv->channel - drop it */
     g_object_unref (channel);
@@ -1678,18 +1683,6 @@ _mcd_dispatch_operation_check_finished (McdDispatchOperation *self)
                 g_critical ("McdChannel has already lost its TpChannel: %p",
                     lost_channel);
             }
-            else
-            {
-                const GError *error = mcd_channel_get_error (lost_channel);
-                gchar *error_name = _mcd_build_error_string (error);
-
-                DEBUG ("%s/%p losing channel %s: %s: %s",
-                       self->priv->unique_name, self, object_path, error_name,
-                       error->message);
-                tp_svc_channel_dispatch_operation_emit_channel_lost (self,
-                    object_path, error_name, error->message);
-                g_free (error_name);
-            }
 
             g_object_unref (lost_channel);
         }
@@ -2169,7 +2162,7 @@ _mcd_dispatch_operation_run_approvers (McdDispatchOperation *self)
 
         tp_cli_client_approver_call_add_dispatch_operation (
             (TpClient *) client, -1,
-            channel_details, dispatch_operation, properties,
+            dispatch_operation, properties,
             add_dispatch_operation_cb,
             g_object_ref (self), g_object_unref, NULL);
 
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 67ba93a..e6827a9 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -152,6 +152,8 @@ enum
 };
 
 static void on_operation_finished (McdDispatchOperation *operation,
+                                   const gchar *dbus_error,
+                                   const gchar *message,
                                    McdDispatcher *self);
 
 static void
@@ -212,6 +214,8 @@ mcd_dispatcher_dup_possible_handlers (McdDispatcher *self,
 
 static void
 on_operation_finished (McdDispatchOperation *operation,
+                       const gchar *dbus_error,
+                       const gchar *message,
                        McdDispatcher *self)
 {
     GList *its_link;
diff --git a/tests/twisted/dispatcher/already-has-channel.py b/tests/twisted/dispatcher/already-has-channel.py
index 367c724..4d38298 100644
--- a/tests/twisted/dispatcher/already-has-channel.py
+++ b/tests/twisted/dispatcher/already-has-channel.py
@@ -174,8 +174,7 @@ def test(q, bus, mc):
                 handled=False),
             )
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
     assert k.args == e.args
 
     q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/approver-fails.py b/tests/twisted/dispatcher/approver-fails.py
index 2fb6304..ef49f56 100644
--- a/tests/twisted/dispatcher/approver-fails.py
+++ b/tests/twisted/dispatcher/approver-fails.py
@@ -25,7 +25,7 @@ import dbus.bus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async, sync_dbus
+        call_async, sync_dbus, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -101,8 +101,8 @@ def test(q, bus, mc):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
@@ -126,8 +126,7 @@ def test(q, bus, mc):
             interface=cs.APPROVER, method='AddDispatchOperation',
             handled=False)
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
 
     # Empathy rejects the channels
     q.dbus_raise(e.message, cs.NOT_AVAILABLE, 'Blind drunk', bus=empathy_bus)
diff --git a/tests/twisted/dispatcher/bypass-approval.py b/tests/twisted/dispatcher/bypass-approval.py
index 0556537..16c7168 100644
--- a/tests/twisted/dispatcher/bypass-approval.py
+++ b/tests/twisted/dispatcher/bypass-approval.py
@@ -25,7 +25,7 @@ import dbus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async, sync_dbus
+        call_async, sync_dbus, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -144,7 +144,8 @@ def expect_and_exercise_approval(q, bus, chan, channel_properties,
                 handled=False),
             )
 
-    assert e.args[0] == [(chan.object_path, channel_properties)]
+    assertEquals(chan.object_path, e.args[1][cs.CDO + '.Channel'])
+    assertEquals(channel_properties, e.args[1][cs.CDO + '.ChannelProperties'])
     assert k.args == e.args
 
     # Both Approvers indicate that they are ready to proceed
diff --git a/tests/twisted/dispatcher/capture-bundle.py b/tests/twisted/dispatcher/capture-bundle.py
index 542456a..1ce247b 100644
--- a/tests/twisted/dispatcher/capture-bundle.py
+++ b/tests/twisted/dispatcher/capture-bundle.py
@@ -153,8 +153,7 @@ def test(q, bus, mc):
                 handled=False),
             )
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
     assert k.args == e.args
 
     q.dbus_return(e.message, signature='')
diff --git a/tests/twisted/dispatcher/cdo-claim.py b/tests/twisted/dispatcher/cdo-claim.py
index 0683acc..01d9410 100644
--- a/tests/twisted/dispatcher/cdo-claim.py
+++ b/tests/twisted/dispatcher/cdo-claim.py
@@ -82,7 +82,7 @@ def test(q, bus, mc):
                 handled=False),
             )
 
-    channels, cdo_path, props = k.args
+    cdo_path, props = k.args
 
     cdo = bus.get_object(cs.CD, cdo_path)
     cdo_iface = dbus.Interface(cdo, cs.CDO)
diff --git a/tests/twisted/dispatcher/dispatch-activatable.py b/tests/twisted/dispatcher/dispatch-activatable.py
index 2e2dff0..c9850eb 100644
--- a/tests/twisted/dispatcher/dispatch-activatable.py
+++ b/tests/twisted/dispatcher/dispatch-activatable.py
@@ -24,7 +24,7 @@ import dbus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async
+        call_async, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -92,8 +92,8 @@ def test(q, bus, mc):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
diff --git a/tests/twisted/dispatcher/dispatch-text.py b/tests/twisted/dispatcher/dispatch-text.py
index cc20645..90b9ad4 100644
--- a/tests/twisted/dispatcher/dispatch-text.py
+++ b/tests/twisted/dispatcher/dispatch-text.py
@@ -25,7 +25,7 @@ import dbus.bus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async, sync_dbus
+        call_async, sync_dbus, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -110,8 +110,8 @@ def test(q, bus, mc):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
@@ -155,8 +155,7 @@ def test(q, bus, mc):
                 handled=False),
             )
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
     assert k.args == e.args
 
     q.dbus_return(e.message, bus=empathy_bus, signature='')
@@ -242,8 +241,8 @@ def test(q, bus, mc):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
@@ -287,8 +286,7 @@ def test(q, bus, mc):
                 handled=False),
             )
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
     assert k.args == e.args
 
     q.dbus_return(e.message, bus=empathy_bus, signature='')
@@ -411,8 +409,7 @@ def test(q, bus, mc):
                 handled=False),
             )
 
-    assert e.args == [[(claimed_chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
     assert k.args == e.args
 
     q.dbus_return(e.message, bus=empathy_bus, signature='')
diff --git a/tests/twisted/dispatcher/ensure-is-approval.py b/tests/twisted/dispatcher/ensure-is-approval.py
index f6910cc..2ceea63 100644
--- a/tests/twisted/dispatcher/ensure-is-approval.py
+++ b/tests/twisted/dispatcher/ensure-is-approval.py
@@ -26,7 +26,7 @@ import dbus.bus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async, sync_dbus
+        call_async, sync_dbus, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -118,8 +118,8 @@ def test(q, bus, mc):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
@@ -163,8 +163,7 @@ def test(q, bus, mc):
                 handled=False),
             )
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
     assert k.args == e.args
 
     q.dbus_return(e.message, bus=empathy_bus, signature='')
diff --git a/tests/twisted/dispatcher/exploding-bundles.py b/tests/twisted/dispatcher/exploding-bundles.py
index 40f1a21..5505b6f 100644
--- a/tests/twisted/dispatcher/exploding-bundles.py
+++ b/tests/twisted/dispatcher/exploding-bundles.py
@@ -24,7 +24,7 @@ import dbus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async
+        call_async, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -119,6 +119,8 @@ def test(q, bus, mc):
 
     assert text_cdo_properties[cs.CDO + '.Account'] == account.object_path
     assert text_cdo_properties[cs.CDO + '.Connection'] == conn.object_path
+    assertEquals(text_chan.object_path, text_cdo_properties[cs.CDO + '.Channel'])
+    assertEquals(text_channel_properties, text_cdo_properties[cs.CDO + '.ChannelProperties'])
 
     handlers = text_cdo_properties[cs.CDO + '.PossibleHandlers'][:]
     assert (sorted(handlers) ==
@@ -204,7 +206,7 @@ def test(q, bus, mc):
             EventPattern('dbus-method-call',
                 path=empathy.object_path,
                 interface=cs.APPROVER, method='AddDispatchOperation',
-                predicate=lambda e: e.args[1] == text_cdo_path,
+                predicate=lambda e: e.args[0] == text_cdo_path,
                 handled=False),
             EventPattern('dbus-method-call',
                 path=kopete.object_path,
@@ -213,19 +215,16 @@ def test(q, bus, mc):
             EventPattern('dbus-method-call',
                 path=empathy.object_path,
                 interface=cs.APPROVER, method='AddDispatchOperation',
-                predicate=lambda e: e.args[1] == media_cdo_path,
+                predicate=lambda e: e.args[0] == media_cdo_path,
                 handled=False)
             )
-    assert len(e_approve_text.args[0]) == 1
-    assert ((text_chan.object_path, text_channel_properties) in
-            e_approve_text.args[0])
-    assert e_approve_text.args[1:] == [text_cdo_path, text_cdo_properties]
-    assert k_approve_text.args == e_approve_text.args
 
-    assert len(e_approve_media.args[0]) == 1
-    assert ((media_chan.object_path, media_channel_properties) in
-            e_approve_media.args[0])
-    assert e_approve_media.args[1:] == [media_cdo_path, media_cdo_properties]
+    assertEquals(text_cdo_path, e_approve_text.args[0])
+    assertEquals(text_cdo_properties, e_approve_text.args[1])
+    assertEquals(k_approve_text.args, e_approve_text.args)
+
+    assertEquals(media_cdo_path, e_approve_media.args[0])
+    assertEquals(media_cdo_properties, e_approve_media.args[1])
 
     q.dbus_return(e_approve_text.message, signature='')
     q.dbus_return(k_approve_text.message, signature='')
@@ -341,21 +340,21 @@ def test(q, bus, mc):
                 path=empathy.object_path,
                 interface=cs.APPROVER, method='AddDispatchOperation',
                 predicate=(lambda e:
-                    e.args[0][0][0] ==
+                    e.args[1][cs.CDO + '.Channel'] ==
                     media_chan.object_path),
                 handled=False),
             EventPattern('dbus-method-call',
                 path=empathy.object_path,
                 interface=cs.APPROVER, method='AddDispatchOperation',
                 predicate=(lambda e:
-                    e.args[0][0][0] ==
+                    e.args[1][cs.CDO + '.Channel'] ==
                     text_chan.object_path),
                 handled=False),
             EventPattern('dbus-method-call',
                 path=kopete.object_path,
                 interface=cs.APPROVER, method='AddDispatchOperation',
                 predicate=(lambda e:
-                    e.args[0][0][0] ==
+                    e.args[1][cs.CDO + '.Channel'] ==
                     text_chan.object_path),
                 handled=False),
             EventPattern('dbus-method-call',
diff --git a/tests/twisted/dispatcher/handle-channels-fails.py b/tests/twisted/dispatcher/handle-channels-fails.py
index 858f197..8f7da75 100644
--- a/tests/twisted/dispatcher/handle-channels-fails.py
+++ b/tests/twisted/dispatcher/handle-channels-fails.py
@@ -25,7 +25,7 @@ import dbus.bus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async, sync_dbus
+        call_async, sync_dbus, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -114,8 +114,8 @@ def test(q, bus, mc):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
@@ -139,8 +139,7 @@ def test(q, bus, mc):
             interface=cs.APPROVER, method='AddDispatchOperation',
             handled=False)
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
 
     q.dbus_return(e.message, bus=empathy_bus, signature='')
 
diff --git a/tests/twisted/dispatcher/lose-text.py b/tests/twisted/dispatcher/lose-text.py
index 42083c2..0cc0992 100644
--- a/tests/twisted/dispatcher/lose-text.py
+++ b/tests/twisted/dispatcher/lose-text.py
@@ -138,8 +138,7 @@ def test(q, bus, mc):
                 handled=False),
             )
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
     assert k.args == e.args
 
     q.dbus_return(e.message, signature='')
@@ -162,12 +161,9 @@ def test(q, bus, mc):
 
     # ... and in response, the channel dispatch operation finishes
 
-    e = q.expect('dbus-signal', path=cdo_path, signal='ChannelLost')
-    assert e.args[0] == chan.object_path
+    q.expect('dbus-signal', path=cdo_path, signal='Finished')
     # FIXME: e.args[1:] == [...Disconnected, 'Channel aborted'] which doesn't
     #   seem like the most appropriate thing for MC to do
-
-    q.expect('dbus-signal', path=cdo_path, signal='Finished')
     q.expect('dbus-signal', path=cs.CD_PATH,
         signal='DispatchOperationFinished', args=[cdo_path])
 
diff --git a/tests/twisted/dispatcher/recover-from-disconnect.py b/tests/twisted/dispatcher/recover-from-disconnect.py
index 2074310..396a67e 100644
--- a/tests/twisted/dispatcher/recover-from-disconnect.py
+++ b/tests/twisted/dispatcher/recover-from-disconnect.py
@@ -21,7 +21,7 @@ import dbus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async, sync_dbus
+        call_async, sync_dbus, assertEquals
 from mctest import exec_test, SimulatedConnection, create_fakecm_account,\
         SimulatedChannel, SimulatedClient, expect_client_setup
 import constants as cs
@@ -189,8 +189,8 @@ def test_dispatching(q, bus, conn, account, empathy, kopete):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
@@ -234,8 +234,7 @@ def test_dispatching(q, bus, conn, account, empathy, kopete):
                 handled=False),
             )
 
-    assert e.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert e.args == [cdo_path, cdo_properties]
     assert k.args == e.args
 
     q.dbus_return(e.message, bus=empathy_bus, signature='')
diff --git a/tests/twisted/dispatcher/redispatch-channels.py b/tests/twisted/dispatcher/redispatch-channels.py
index ea732c6..fa9053d 100644
--- a/tests/twisted/dispatcher/redispatch-channels.py
+++ b/tests/twisted/dispatcher/redispatch-channels.py
@@ -230,7 +230,7 @@ def test(q, bus, mc):
         interface=cs.APPROVER, method='AddDispatchOperation',
         handled=False)
 
-    channels, cdo_path,props = e.args
+    cdo_path, props = e.args
 
     cdo = ChannelDispatchOperation(bus, cdo_path)
 
diff --git a/tests/twisted/dispatcher/respawn-activatable-observers.py b/tests/twisted/dispatcher/respawn-activatable-observers.py
index e330beb..2736e55 100644
--- a/tests/twisted/dispatcher/respawn-activatable-observers.py
+++ b/tests/twisted/dispatcher/respawn-activatable-observers.py
@@ -25,7 +25,7 @@ import dbus.bus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async, sync_dbus
+        call_async, sync_dbus, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -109,8 +109,8 @@ def test(q, bus, mc):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
@@ -119,8 +119,7 @@ def test(q, bus, mc):
                 interface=cs.APPROVER, method='AddDispatchOperation',
                 handled=False)
 
-    assert k.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert k.args == [cdo_path, cdo_properties]
 
     q.dbus_return(k.message, bus=kopete_bus, signature='')
 
diff --git a/tests/twisted/dispatcher/respawn-observers.py b/tests/twisted/dispatcher/respawn-observers.py
index 3cdaaa1..fec35e7 100644
--- a/tests/twisted/dispatcher/respawn-observers.py
+++ b/tests/twisted/dispatcher/respawn-observers.py
@@ -25,7 +25,7 @@ import dbus.bus
 import dbus.service
 
 from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
-        call_async, sync_dbus
+        call_async, sync_dbus, assertEquals
 from mctest import exec_test, SimulatedConnection, SimulatedClient, \
         create_fakecm_account, enable_fakecm_account, SimulatedChannel, \
         expect_client_setup
@@ -113,8 +113,8 @@ def test(q, bus, mc):
             cdo_properties[cs.CDO + '.Interfaces']
     assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path,
-        channel_properties)]
+    assert cdo_props_iface.Get(cs.CDO, 'Channel') == chan.object_path
+    assertEquals(channel_properties, cdo_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo_properties[cs.CDO + '.PossibleHandlers']
 
@@ -144,8 +144,7 @@ def test(q, bus, mc):
                 interface=cs.APPROVER, method='AddDispatchOperation',
                 handled=False)
 
-    assert k.args == [[(chan.object_path, channel_properties)],
-            cdo_path, cdo_properties]
+    assert k.args == [cdo_path, cdo_properties]
 
     q.dbus_return(k.message, bus=kopete_bus, signature='')
 
@@ -218,8 +217,8 @@ def test(q, bus, mc):
             cdo2_properties[cs.CDO + '.Interfaces']
     assert cdo2_props_iface.Get(cs.CDO, 'Connection') == conn.object_path
     assert cdo2_props_iface.Get(cs.CDO, 'Account') == account.object_path
-    assert cdo2_props_iface.Get(cs.CDO, 'Channels') == [(chan2.object_path,
-        channel2_properties)]
+    assert cdo2_props_iface.Get(cs.CDO, 'Channel') == chan2.object_path
+    assertEquals(channel2_properties, cdo2_props_iface.Get(cs.CDO, 'ChannelProperties'))
     assert cdo2_props_iface.Get(cs.CDO, 'PossibleHandlers') == \
             cdo2_properties[cs.CDO + '.PossibleHandlers']
 
@@ -249,8 +248,7 @@ def test(q, bus, mc):
                 interface=cs.APPROVER, method='AddDispatchOperation',
                 handled=False)
 
-    assert k.args == [[(chan2.object_path, channel2_properties)],
-            cdo2_path, cdo2_properties]
+    assert k.args == [cdo2_path, cdo2_properties]
 
     q.dbus_return(k.message, bus=kopete_bus, signature='')
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git



More information about the Pkg-telepathy-commits mailing list