summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-22 14:27:06 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-22 14:30:08 +0100
commit8b204874056d6475c12a81eed4d5144bfbf33e2f (patch)
tree4f1690e583b3f52c7f71befb20784892fc1bbe7e
parentf7c2910ea656dabe1cf6fb8dabda0779fe119730 (diff)
Don't assert that GetAll(Avatars1) will work before Connected
It's conditional now.
-rw-r--r--tests/twisted/avatar-requirements.py43
1 files changed, 25 insertions, 18 deletions
diff --git a/tests/twisted/avatar-requirements.py b/tests/twisted/avatar-requirements.py
index 83d155e..a4b59b4 100644
--- a/tests/twisted/avatar-requirements.py
+++ b/tests/twisted/avatar-requirements.py
@@ -1,27 +1,34 @@
-from servicetest import call_async, EventPattern
+from dbus import (DBusException)
+
+from servicetest import (call_async, EventPattern, assertContains)
from hazetest import exec_test
import constants as cs
def test(q, bus, conn, stream):
- props = conn.GetAll(cs.CONN_IFACE_AVATARS,
+ try:
+ props = conn.GetAll(cs.CONN_IFACE_AVATARS,
dbus_interface=cs.PROPERTIES_IFACE)
- types = props['SupportedAvatarMIMETypes']
- minw = props['MinimumAvatarWidth']
- minh = props['MinimumAvatarHeight']
- maxw = props['MaximumAvatarWidth']
- maxh = props['MaximumAvatarHeight']
- maxb = props['MaximumAvatarBytes']
- rech = props['RecommendedAvatarHeight']
- recw = props['RecommendedAvatarWidth']
+ except DBusException, e:
+ assertContains(e.get_dbus_name(),
+ ['org.freedesktop.DBus.Error.InvalidArgs'])
+ else:
+ types = props['SupportedAvatarMIMETypes']
+ minw = props['MinimumAvatarWidth']
+ minh = props['MinimumAvatarHeight']
+ maxw = props['MaximumAvatarWidth']
+ maxh = props['MaximumAvatarHeight']
+ maxb = props['MaximumAvatarBytes']
+ rech = props['RecommendedAvatarHeight']
+ recw = props['RecommendedAvatarWidth']
- assert types == [], types
- assert minw == 0, minw
- assert minh == 0, minh
- assert maxw == 0, maxw
- assert maxh == 0, maxh
- assert maxb == 0, maxb
- assert recw == 0, recw
- assert rech == 0, rech
+ assert types == [], types
+ assert minw == 0, minw
+ assert minh == 0, minh
+ assert maxw == 0, maxw
+ assert maxh == 0, maxh
+ assert maxb == 0, maxb
+ assert recw == 0, recw
+ assert rech == 0, rech
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged',