changeset 3021:313a1d430bcb

Skip the XEP-115 test if pyxmpp is not available.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Sun, 13 Jan 2008 23:57:13 +0100
parents 945368f271ef
children e757ebc436e7
files jabberbot/_tests/test_capat.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jabberbot/_tests/test_capat.py	Sun Jan 06 23:39:24 2008 +0100
+++ b/jabberbot/_tests/test_capat.py	Sun Jan 13 23:57:13 2008 +0100
@@ -1,7 +1,11 @@
 # -*- coding: utf-8 -*-
 
-import py.test
-from jabberbot import capat
+import py
+
+try:
+    from jabberbot import capat
+except ImportError:
+    py.test.skip("Skipping jabber bot tests - pyxmpp is not installed")
 
 def test_ver_simple():
     # example values supplied by the XEP
@@ -33,6 +37,7 @@
         import pyxmpp.iq
     except ImportError:
         py.test.skip("pyxmpp needs to be installed for this test")
+
     x = pyxmpp.iq.Iq(stanza_type='result', stanza_id='disco1',
                      from_jid='romeo@montague.lit/orchard',
                      to_jid='juliet@capulet.lit/chamber')
@@ -49,3 +54,4 @@
 
     assert capat.hash_iq(x) == "8RovUdtOmiAjzj+xI7SK5BCw3A8="
     # hash value taken from `test_ver_simple`
+