[Telepathy-commits] [telepathy-gabble/master] use caps_helper.make_caps_disco_reply instead of our own copy of it

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Mar 6 08:00:25 PST 2009


---
 tests/twisted/jingle/jingletest.py             |   15 ++-------------
 tests/twisted/tubes/offer-private-dbus-tube.py |   16 +++-------------
 2 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/tests/twisted/jingle/jingletest.py b/tests/twisted/jingle/jingletest.py
index 72dcd91..ca84deb 100644
--- a/tests/twisted/jingle/jingletest.py
+++ b/tests/twisted/jingle/jingletest.py
@@ -3,22 +3,11 @@ Jingle (XEP-0166) testing support.
 """
 
 import random
-from gabbletest import make_result_iq, make_presence
+from gabbletest import make_presence
 from twisted.words.xish import domish
 from twisted.words.protocols.jabber.client import IQ
 import dbus
-
-def make_caps_disco_reply(stream, req, features):
-    iq = make_result_iq(stream, req)
-    query = iq.firstChildElement()
-
-    for f in features:
-        el = domish.Element((None, 'feature'))
-        el['var'] = f
-        query.addChild(el)
-
-    return iq
-
+from caps_helper import make_caps_disco_reply
 
 class JingleTest:
 
diff --git a/tests/twisted/tubes/offer-private-dbus-tube.py b/tests/twisted/tubes/offer-private-dbus-tube.py
index 93928e0..74cc3e4 100644
--- a/tests/twisted/tubes/offer-private-dbus-tube.py
+++ b/tests/twisted/tubes/offer-private-dbus-tube.py
@@ -5,13 +5,14 @@ from dbus.connection import Connection
 from dbus.lowlevel import SignalMessage
 
 from servicetest import call_async, EventPattern, unwrap, watch_tube_signals
-from gabbletest import make_result_iq, sync_stream, make_presence
+from gabbletest import sync_stream, make_presence
 import constants as cs
 import tubetestutil as t
 
-from twisted.words.xish import domish, xpath
+from twisted.words.xish import xpath
 import ns
 from bytestream import create_from_si_offer
+from caps_helper import make_caps_disco_reply
 
 sample_parameters = dbus.Dictionary({
     's': 'hello',
@@ -20,17 +21,6 @@ sample_parameters = dbus.Dictionary({
     'i': dbus.Int32(-123),
     }, signature='sv')
 
-def make_caps_disco_reply(stream, req, features):
-    iq = make_result_iq(stream, req)
-    query = iq.firstChildElement()
-
-    for f in features:
-        el = domish.Element((None, 'feature'))
-        el['var'] = f
-        query.addChild(el)
-
-    return iq
-
 def alice_accepts_tube(q, stream, iq_event, dbus_tube_id, bytestream_cls):
     iq = iq_event.stanza
 
-- 
1.5.6.5



More information about the telepathy-commits mailing list