[Telepathy-commits] [telepathy-gabble/master] roster/groups test: if assertions fail, print more useful info
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Aug 19 10:51:50 PDT 2008
20080423142910-53eee-58f7dac044c2a51c1e991cab445925d3865e9bd1.gz
---
tests/twisted/roster/groups.py | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/tests/twisted/roster/groups.py b/tests/twisted/roster/groups.py
index 2e07ee5..d04092a 100644
--- a/tests/twisted/roster/groups.py
+++ b/tests/twisted/roster/groups.py
@@ -15,24 +15,28 @@ HT_GROUP = 4
def _expect_contact_list_channel(q, bus, conn, name, contacts):
event = q.expect('dbus-signal', signal='NewChannel')
path, type, handle_type, handle, suppress_handler = event.args
- assert type == u'org.freedesktop.Telepathy.Channel.Type.ContactList'
- assert handle_type == HT_CONTACT_LIST
- assert conn.InspectHandles(handle_type, [handle])[0] == name
+ assert type == u'org.freedesktop.Telepathy.Channel.Type.ContactList', type
+ assert handle_type == HT_CONTACT_LIST, handle_type
+ inspected = conn.InspectHandles(handle_type, [handle])[0]
+ assert inspected == name, (inspected, name)
chan = bus.get_object(conn._named_service, path)
group_iface = dbus.Interface(chan,
u'org.freedesktop.Telepathy.Channel.Interface.Group')
- assert conn.InspectHandles(1, group_iface.GetMembers()) == contacts
+ inspected = conn.InspectHandles(1, group_iface.GetMembers())
+ assert inspected == contacts, (inspected, contacts)
def _expect_group_channel(q, bus, conn, name, contacts):
event = q.expect('dbus-signal', signal='NewChannel')
path, type, handle_type, handle, suppress_handler = event.args
- assert type == u'org.freedesktop.Telepathy.Channel.Type.ContactList'
- assert handle_type == HT_GROUP
- assert conn.InspectHandles(handle_type, [handle])[0] == name
+ assert type == u'org.freedesktop.Telepathy.Channel.Type.ContactList', type
+ assert handle_type == HT_GROUP, handle_type
+ inspected = conn.InspectHandles(handle_type, [handle])[0]
+ assert inspected == name, (inspected, name)
chan = bus.get_object(conn._named_service, path)
group_iface = dbus.Interface(chan,
u'org.freedesktop.Telepathy.Channel.Interface.Group')
- assert conn.InspectHandles(1, group_iface.GetMembers()) == contacts
+ inspected = conn.InspectHandles(1, group_iface.GetMembers())
+ assert inspected == contacts, (inspected, contacts)
def test(q, bus, conn, stream):
conn.Connect()
--
1.5.6.3
More information about the Telepathy-commits
mailing list