[telepathy-gabble/master] caps_helper: receive_presence_and_ask_caps: allow not expecting the D-Bus signal
Simon McVittie
simon.mcvittie at collabora.co.uk
Mon Jul 27 09:44:54 PDT 2009
---
tests/twisted/caps_helper.py | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/tests/twisted/caps_helper.py b/tests/twisted/caps_helper.py
index eb0376c..9e89354 100644
--- a/tests/twisted/caps_helper.py
+++ b/tests/twisted/caps_helper.py
@@ -113,14 +113,18 @@ def make_caps_disco_reply(stream, req, features, dataforms={}):
return iq
-def receive_presence_and_ask_caps(q, stream):
+def receive_presence_and_ask_caps(q, stream, expect_dbus=True):
# receive presence stanza
- event_stream, event_dbus = q.expect_many(
- EventPattern('stream-presence'),
- EventPattern('dbus-signal', signal='ContactCapabilitiesChanged')
- )
- assert len(event_dbus.args) == 1
- signaled_caps = event_dbus.args[0]
+ if expect_dbus:
+ event_stream, event_dbus = q.expect_many(
+ EventPattern('stream-presence'),
+ EventPattern('dbus-signal', signal='ContactCapabilitiesChanged')
+ )
+ assert len(event_dbus.args) == 1
+ signaled_caps = event_dbus.args[0]
+ else:
+ event_stream = q.expect('stream-presence')
+ signaled_caps = None
c_nodes = xpath.queryForNodes('/presence/c', event_stream.stanza)
assert c_nodes is not None
--
1.5.6.5
More information about the telepathy-commits
mailing list