[telepathy-gabble/master] Set event.query to None on empty IQs.
Will Thompson
will.thompson at collabora.co.uk
Thu Mar 26 09:02:17 PDT 2009
---
tests/twisted/gabbletest.py | 2 ++
tests/twisted/jingle/jingletest2.py | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/twisted/gabbletest.py b/tests/twisted/gabbletest.py
index 26c0932..d4e673b 100644
--- a/tests/twisted/gabbletest.py
+++ b/tests/twisted/gabbletest.py
@@ -207,6 +207,8 @@ def make_iq_event(iq):
if query.getAttribute("node"):
event.query_node = query.getAttribute("node")
+ else:
+ event.query = None
return event
diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index b7c7597..a214530 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -104,7 +104,7 @@ class JingleProtocol:
return ('feature', None, { 'var': var }, [])
def match_jingle_action(self, q, action):
- return q.name == 'jingle' and q['action'] == action
+ return q is not None and q.name == 'jingle' and q['action'] == action
def extract_session_id(self, query):
return query['sid']
@@ -148,7 +148,7 @@ class GtalkProtocol03(JingleProtocol):
def match_jingle_action(self, q, action):
action = self._action_map(action)
- return q.name == 'session' and q['type'] == action
+ return q is not None and q.name == 'session' and q['type'] == action
# Content will never pick up transport, so this can return invalid value
def TransportGoogleP2P(self):
@@ -194,7 +194,7 @@ class GtalkProtocol04(JingleProtocol):
def match_jingle_action(self, q, action):
action = self._action_map(action)
- return q.name == 'session' and q['type'] == action
+ return q is not None and q.name == 'session' and q['type'] == action
def extract_session_id(self, query):
return query['id']
--
1.5.6.5
More information about the telepathy-commits
mailing list