summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-01 11:19:47 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-04 12:14:36 +0000
commitfe9f456a4b5dd457ca19a986bbcbac5acad360b2 (patch)
tree74d9bfd17ad6a7f94fb7e119202946f9fd3b7e30 /tests
parent6b005f6cc8373fbc60deb853e38c0c5452cf8d57 (diff)
Use telepathy-glib for Sidecars1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=26609 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/constants.py3
-rw-r--r--tests/twisted/gateways.py2
-rw-r--r--tests/twisted/servicetest.py3
-rw-r--r--tests/twisted/sidecar-own-caps.py2
-rw-r--r--tests/twisted/sidecars.py20
5 files changed, 17 insertions, 13 deletions
diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index 52f8ba372..e21bc134a 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -204,6 +204,8 @@ CONN_IFACE_CONTACTS = CONN + '.Interface.Contacts'
CONN_IFACE_CONTACT_CAPS = CONN + '.Interface.ContactCapabilities'
CONN_IFACE_CONTACT_INFO = CONN + ".Interface.ContactInfo"
CONN_IFACE_PRESENCE = CONN + '.Interface.Presence'
+CONN_IFACE_RENAMING = CONN + '.Interface.Renaming'
+CONN_IFACE_SIDECARS1 = CONN + '.Interface.Sidecars1'
CONN_IFACE_SIMPLE_PRESENCE = CONN + '.Interface.SimplePresence'
CONN_IFACE_REQUESTS = CONN + '.Interface.Requests'
CONN_IFACE_LOCATION = CONN + '.Interface.Location'
@@ -607,6 +609,7 @@ CR = PREFIX + '.ChannelRequest'
CDO = PREFIX + '.ChannelDispatchOperation'
CD = PREFIX + '.ChannelDispatcher'
+CD_IFACE_MESSAGES1 = PREFIX + '.ChannelDispatcher.Interface.Messages1'
CD_IFACE_OP_LIST = PREFIX + '.ChannelDispatcher.Interface.OperationList'
CD_PATH = PATH_PREFIX + '/ChannelDispatcher'
CD_REDISPATCH = CD + '.Interface.Redispatch.DRAFT'
diff --git a/tests/twisted/gateways.py b/tests/twisted/gateways.py
index 3934971b2..ebe1b2ef7 100644
--- a/tests/twisted/gateways.py
+++ b/tests/twisted/gateways.py
@@ -63,7 +63,7 @@ def test_not_acceptable(q, gateways_iface, stream):
def test(q, bus, conn, stream):
# Request a sidecar thate we support before we're connected; it should just
# wait around until we're connected.
- call_async(q, conn.Future, 'EnsureSidecar', PLUGIN_IFACE)
+ call_async(q, conn.Sidecars1, 'EnsureSidecar', PLUGIN_IFACE)
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged',
diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index 885bfe205..5ff61a468 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -633,7 +633,6 @@ def wrap_connection(conn):
('ContactCapabilities', cs.CONN_IFACE_CONTACT_CAPS),
('ContactInfo', cs.CONN_IFACE_CONTACT_INFO),
('Location', cs.CONN_IFACE_LOCATION),
- ('Future', tp_name_prefix + '.Connection.FUTURE'),
('MailNotification', cs.CONN_IFACE_MAIL_NOTIFICATION),
('ContactList', cs.CONN_IFACE_CONTACT_LIST),
('ContactGroups', cs.CONN_IFACE_CONTACT_GROUPS),
@@ -641,6 +640,8 @@ def wrap_connection(conn):
('PowerSaving', cs.CONN_IFACE_POWER_SAVING),
('Addressing', cs.CONN_IFACE_ADDRESSING),
('ClientTypes', cs.CONN_IFACE_CLIENT_TYPES),
+ ('Renaming', cs.CONN_IFACE_RENAMING),
+ ('Sidecars1', cs.CONN_IFACE_SIDECARS1),
]))
class ChannelWrapper(ProxyWrapper):
diff --git a/tests/twisted/sidecar-own-caps.py b/tests/twisted/sidecar-own-caps.py
index b02510b72..9e8b9cdfb 100644
--- a/tests/twisted/sidecar-own-caps.py
+++ b/tests/twisted/sidecar-own-caps.py
@@ -23,7 +23,7 @@ def test(q, bus, conn, stream):
# created.
pattern = EventPattern('stream-iq', to='sidecar.example.com',
query_ns='http://example.com/sidecar')
- call_async(q, conn.Future, 'EnsureSidecar', TEST_PLUGIN_IFACE + ".IQ")
+ call_async(q, conn.Sidecars1, 'EnsureSidecar', TEST_PLUGIN_IFACE + ".IQ")
e = q.expect_many(pattern)[0]
# The server said yes, so we should get a sidecar back!
diff --git a/tests/twisted/sidecars.py b/tests/twisted/sidecars.py
index 61b863dee..00b8c56af 100644
--- a/tests/twisted/sidecars.py
+++ b/tests/twisted/sidecars.py
@@ -18,7 +18,7 @@ if not PLUGINS_ENABLED:
def test(q, bus, conn, stream):
# Request a sidecar thate we support before we're connected; it should just
# wait around until we're connected.
- call_async(q, conn.Future, 'EnsureSidecar', TEST_PLUGIN_IFACE)
+ call_async(q, conn.Sidecars1, 'EnsureSidecar', TEST_PLUGIN_IFACE)
if PLUGINS_ENABLED:
# Now we're connected, the call we made earlier should return.
@@ -28,30 +28,30 @@ def test(q, bus, conn, stream):
assertEquals({}, props)
# We should get the same sidecar if we request it again
- path2, props2 = conn.Future.EnsureSidecar(TEST_PLUGIN_IFACE)
+ path2, props2 = conn.Sidecars1.EnsureSidecar(TEST_PLUGIN_IFACE)
assertEquals((path, props), (path2, props2))
else:
# Only now does it fail.
q.expect('dbus-error', method='EnsureSidecar')
# This is not a valid interface name
- call_async(q, conn.Future, 'EnsureSidecar', 'not an interface')
+ call_async(q, conn.Sidecars1, 'EnsureSidecar', 'not an interface')
q.expect('dbus-error', name=cs.INVALID_ARGUMENT)
# The test plugin makes no reference to this interface.
- call_async(q, conn.Future, 'EnsureSidecar', 'unsupported.sidecar')
+ call_async(q, conn.Sidecars1, 'EnsureSidecar', 'unsupported.sidecar')
q.expect('dbus-error', name=cs.NOT_IMPLEMENTED)
if PLUGINS_ENABLED:
# This sidecar does have some properties:
- path, props = conn.Future.EnsureSidecar(TEST_PLUGIN_IFACE + ".Props")
+ path, props = conn.Sidecars1.EnsureSidecar(TEST_PLUGIN_IFACE + ".Props")
assertContains(TEST_PLUGIN_IFACE + ".Props.Greeting", props)
# The plugin claims it implements this sidecar, but actually doesn't.
# Check that we don't blow up (although this is no different from
# Gabble's perspective to creating a sidecar failing because a network
# service wasn't there, for instance).
- call_async(q, conn.Future, 'EnsureSidecar',
+ call_async(q, conn.Sidecars1, 'EnsureSidecar',
TEST_PLUGIN_IFACE + ".Buggy")
q.expect('dbus-error', name=cs.NOT_IMPLEMENTED)
@@ -59,7 +59,7 @@ def test(q, bus, conn, stream):
# created.
pattern = EventPattern('stream-iq', to='sidecar.example.com',
query_ns='http://example.com/sidecar')
- call_async(q, conn.Future, 'EnsureSidecar', TEST_PLUGIN_IFACE + ".IQ")
+ call_async(q, conn.Sidecars1, 'EnsureSidecar', TEST_PLUGIN_IFACE + ".IQ")
e = q.expect_many(pattern)[0]
sync_dbus(bus, q, conn)
@@ -70,7 +70,7 @@ def test(q, bus, conn, stream):
# Let's try again. The plugin should get a chance to ping the server
# again.
- call_async(q, conn.Future, 'EnsureSidecar', TEST_PLUGIN_IFACE + ".IQ")
+ call_async(q, conn.Sidecars1, 'EnsureSidecar', TEST_PLUGIN_IFACE + ".IQ")
e = q.expect_many(pattern)[0]
# The server said yes, so we should get a sidecar back!
@@ -80,7 +80,7 @@ def test(q, bus, conn, stream):
# If we ask again once the plugin has been created, it should return at
# once without any more network traffic.
q.forbid_events([pattern])
- conn.Future.EnsureSidecar(TEST_PLUGIN_IFACE + ".IQ")
+ conn.Sidecars1.EnsureSidecar(TEST_PLUGIN_IFACE + ".IQ")
sync_stream(q, stream)
# TODO: test ensuring a sidecar that waits for something from the
@@ -96,7 +96,7 @@ def test(q, bus, conn, stream):
EventPattern('stream-closed'),
)
- call_async(q, conn.Future, 'EnsureSidecar', 'zomg.what')
+ call_async(q, conn.Sidecars1, 'EnsureSidecar', 'zomg.what')
# With older telepathy-glib this would be DISCONNECTED;
# with newer telepathy-glib the Connection disappears from the bus
# sooner, and you get UnknownMethod or something from dbus-glib.