[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Only run unittests if oonib is imported



commit 219f0ba3f503c5084e955f240482c06460ea6b3d
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Wed Aug 21 14:54:47 2013 +0200

    Only run unittests if oonib is imported
---
 ooni/tests/test_oonibclient.py |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ooni/tests/test_oonibclient.py b/ooni/tests/test_oonibclient.py
index 17259a6..06008bb 100644
--- a/ooni/tests/test_oonibclient.py
+++ b/ooni/tests/test_oonibclient.py
@@ -1,6 +1,11 @@
 from twisted.trial import unittest
 from twisted.internet import defer
 
+try:
+    import oonib
+except ImportError:
+    oonib = None
+
 from ooni.oonibclient import OONIBClient
 
 input_id = 'e0611ecd28bead38a7afeb4dda8ae3449d0fc2e1ba53fa7355f2799dce9af290'
@@ -8,6 +13,8 @@ input_id = 'e0611ecd28bead38a7afeb4dda8ae3449d0fc2e1ba53fa7355f2799dce9af290'
 class TestOONIBClient(unittest.TestCase):
     def setUp(self):
         self.oonibclient = OONIBClient('http://127.0.0.1:8888')
+        if not oonib:
+            self.skipTest("OONIB is not running")
     
     @defer.inlineCallbacks
     def test_query(self):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits