[Telepathy-commits] [telepathy-gabble/master] actually exclude dbus tube tests if they're not supported

Senko Rasic senko.rasic at collabora.co.uk
Tue Aug 19 10:52:11 PDT 2008


20080506131558-01440-4575693dec730e57860b7b206aab34ed91ee5d2c.gz
---
 tests/twisted/tubes/test-get-available-tubes.py |   13 ++++++++++---
 tests/twisted/tubes/test-muc-offer-dbus-tube.py |    5 ++++-
 tests/twisted/tubes/test-si-tubes.py            |    5 +++++
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/tests/twisted/tubes/test-get-available-tubes.py b/tests/twisted/tubes/test-get-available-tubes.py
index 0e54805..37fa64a 100644
--- a/tests/twisted/tubes/test-get-available-tubes.py
+++ b/tests/twisted/tubes/test-get-available-tubes.py
@@ -7,6 +7,8 @@ from gabbletest import exec_test, make_result_iq, acknowledge_iq
 
 from twisted.words.xish import domish
 
+from gabbleconfig import HAVE_DBUS_TUBES
+
 sample_parameters = dbus.Dictionary({
     's': 'hello',
     'ay': dbus.ByteArray('hello'),
@@ -89,9 +91,14 @@ def test(q, bus, conn, stream):
 
     # test GetAvailableTubeTypes
     tube_types = tubes_iface_muc.GetAvailableTubeTypes()
-    assert len(tube_types) == 2
-    assert 0 in tube_types # D-Bus tube
-    assert 1 in tube_types # Stream tube
+
+    if HAVE_DBUS_TUBES:
+        assert len(tube_types) == 2
+        assert 0 in tube_types # D-Bus tube
+        assert 1 in tube_types # Stream tube
+    else:
+        assert len(tube_types) == 1
+        assert 1 in tube_types # Stream tube
 
     # test GetAvailableStreamTubeTypes
     stream_tubes_types = tubes_iface_muc.GetAvailableStreamTubeTypes()
diff --git a/tests/twisted/tubes/test-muc-offer-dbus-tube.py b/tests/twisted/tubes/test-muc-offer-dbus-tube.py
index c5ada66..016ff04 100644
--- a/tests/twisted/tubes/test-muc-offer-dbus-tube.py
+++ b/tests/twisted/tubes/test-muc-offer-dbus-tube.py
@@ -11,6 +11,8 @@ from gabbletest import exec_test, make_result_iq, acknowledge_iq
 
 from twisted.words.xish import domish, xpath
 
+from gabbleconfig import HAVE_DBUS_TUBES
+
 sample_parameters = dbus.Dictionary({
     's': 'hello',
     'ay': dbus.ByteArray('hello'),
@@ -201,4 +203,5 @@ def test(q, bus, conn, stream):
     q.expect('dbus-signal', signal='StatusChanged', args=[2, 1])
 
 if __name__ == '__main__':
-    exec_test(test)
+    if HAVE_DBUS_TUBES:
+        exec_test(test)
diff --git a/tests/twisted/tubes/test-si-tubes.py b/tests/twisted/tubes/test-si-tubes.py
index de86029..c1ddcc9 100644
--- a/tests/twisted/tubes/test-si-tubes.py
+++ b/tests/twisted/tubes/test-si-tubes.py
@@ -16,6 +16,8 @@ from twisted.internet.protocol import Factory, Protocol
 from twisted.internet import reactor
 from twisted.words.protocols.jabber.client import IQ
 
+from gabbleconfig import HAVE_DBUS_TUBES
+
 NS_TUBES = 'http://telepathy.freedesktop.org/xmpp/tubes'
 NS_SI = 'http://jabber.org/protocol/si'
 NS_FEATURE_NEG = 'http://jabber.org/protocol/feature-neg'
@@ -204,6 +206,9 @@ def test(q, bus, conn, stream):
     binary = base64.b64decode(str(ibb_data))
     assert binary == 'hello, world'
 
+    if not HAVE_DBUS_TUBES:
+        return
+
     # OK, how about D-Bus?
     call_async(q, tubes_iface, 'OfferDBusTube',
         'com.example.TestCase', sample_parameters)
-- 
1.5.6.3




More information about the Telepathy-commits mailing list