summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-17 17:54:53 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-17 17:54:53 +0100
commit92814a55d012c3a6cd5111486f3505ceb6f31984 (patch)
treef2f78d14b5384e54a1737077d9ead2c9db654f4a /tests
parent979e89eeb362e467068d9f1ce3b7f9669ae7da7c (diff)
parent254a277868df1adb1b1db62f43a3c19944f3bf80 (diff)
Merge branch 'telepathy-haze-0.8'
Conflicts: NEWS
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/constants.py1
-rw-r--r--tests/twisted/presence/presence.py13
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index d541c75..37d6d52 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -195,6 +195,7 @@ CONN_IFACE_CONTACT_BLOCKING = CONN + '.Interface.ContactBlocking'
CONN_IFACE_ADDRESSING = CONN + '.Interface.Addressing1'
ATTR_CONTACT_CAPABILITIES = CONN_IFACE_CONTACT_CAPS + '/capabilities'
+ATTR_PRESENCE = CONN_IFACE_SIMPLE_PRESENCE + '/presence'
STREAM_HANDLER = 'org.freedesktop.Telepathy.Media.StreamHandler'
diff --git a/tests/twisted/presence/presence.py b/tests/twisted/presence/presence.py
index a3c5854..e35616e 100644
--- a/tests/twisted/presence/presence.py
+++ b/tests/twisted/presence/presence.py
@@ -1,7 +1,5 @@
"""
A simple smoke-test for C.I.SimplePresence
-
-FIXME: test C.I.Presence too
"""
import dbus
@@ -9,7 +7,9 @@ import dbus
from twisted.words.xish import domish, xpath
from twisted.words.protocols.jabber.client import IQ
+from servicetest import assertEquals
from hazetest import exec_test
+import constants as cs
def test(q, bus, conn, stream):
amy_handle = conn.RequestHandles(1, ['amy@foo.com'])[0]
@@ -48,6 +48,15 @@ def test(q, bus, conn, stream):
# produces.
assert event.args[0] == { amy_handle: (2, 'available', 'I may have been drinking') }
+ amy_handle, asv = conn.Contacts.GetContactByID('amy@foo.com',
+ [cs.CONN_IFACE_SIMPLE_PRESENCE])
+ assertEquals(event.args[0][amy_handle], asv.get(cs.ATTR_PRESENCE))
+
+ bob_handle, asv = conn.Contacts.GetContactByID('bob@foo.com',
+ [cs.CONN_IFACE_SIMPLE_PRESENCE])
+ assertEquals((cs.PRESENCE_UNKNOWN, 'unknown', ''),
+ asv.get(cs.ATTR_PRESENCE))
+
conn.Disconnect()
q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])