[telepathy-gabble/master] Generalize <hold>/<active> event pattern functions
Will Thompson
will.thompson at collabora.co.uk
Wed May 27 07:10:53 PDT 2009
I'm about to make a test check that Gabble sends <ringing/> and
<active/> using these generalized helpers.
---
tests/twisted/jingle/hold-audio.py | 4 ++--
tests/twisted/jingle/hold-av.py | 4 ++--
tests/twisted/jingle/jingletest2.py | 10 +++++-----
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/tests/twisted/jingle/hold-audio.py b/tests/twisted/jingle/hold-audio.py
index 583afc4..80b4ef1 100644
--- a/tests/twisted/jingle/hold-audio.py
+++ b/tests/twisted/jingle/hold-audio.py
@@ -52,8 +52,8 @@ def test(jp, q, bus, conn, stream):
# These are 0- (for old dialects) or 1- (for new dialects) element lists
# that can be splatted into expect_many with *
- hold_event = jp.hold_notification_event_list(True)
- active_event = jp.hold_notification_event_list(False)
+ hold_event = jp.rtp_info_event_list("hold")
+ active_event = jp.rtp_info_event_list("active")
# ---- Test 1: GetHoldState returns unheld and unhold is a no-op ----
hold_state = hold_iface.GetHoldState()
diff --git a/tests/twisted/jingle/hold-av.py b/tests/twisted/jingle/hold-av.py
index d40d078..47521a9 100644
--- a/tests/twisted/jingle/hold-av.py
+++ b/tests/twisted/jingle/hold-av.py
@@ -82,8 +82,8 @@ def test(jp, q, bus, conn, stream):
# These are 0- (for old dialects) or 1- (for new dialects) element lists
# that can be splatted into expect_many with *
- hold_event = jp.hold_notification_event_list(True)
- active_event = jp.hold_notification_event_list(False)
+ hold_event = jp.rtp_info_event_list("hold")
+ active_event = jp.rtp_info_event_list("active")
# ---- Test 1: GetHoldState returns unheld and unhold is a no-op ----
diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index 9b78b81..087a342 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -123,13 +123,14 @@ class JingleProtocol:
def is_modern_jingle(self):
return False
- def hold_notification_event(self, hold=True):
+ def rtp_info_event(self, name):
return None
- def hold_notification_event_list(self, hold=True):
- e = self.hold_notification_event(hold)
+ def rtp_info_event_list(self, name):
+ e = self.rtp_info_event(name)
return [e] if e is not None else []
+
class GtalkProtocol03(JingleProtocol):
features = [ 'http://www.google.com/xmpp/protocol/voice/v1' ]
@@ -275,13 +276,12 @@ class JingleProtocol031(JingleProtocol):
def is_modern_jingle(self):
return True
- def hold_notification_event(self, hold=True):
+ def rtp_info_event(self, name):
def p(e):
query = e.query
if not self.match_jingle_action(query, 'session-info'):
return False
n = query.firstChildElement()
- name = "hold" if hold else "active"
return n is not None and n.uri == ns.JINGLE_RTP_INFO_1 and \
n.name == name
--
1.5.6.5
More information about the telepathy-commits
mailing list