[test] Skip ldap source tests if slapd is not available
authorDenis Laxalde <denis.laxalde@logilab.fr>
Mon, 30 Nov 2015 14:54:30 +0100
changeset 10950 282880f81311
parent 10949 408867c79d9e
child 10951 ef1cfc80d51c
[test] Skip ldap source tests if slapd is not available
server/test/unittest_ldapsource.py
--- a/server/test/unittest_ldapsource.py	Thu Sep 24 09:43:36 2015 +0200
+++ b/server/test/unittest_ldapsource.py	Mon Nov 30 14:54:30 2015 +0100
@@ -27,6 +27,7 @@
 import time
 import subprocess
 import tempfile
+import unittest
 from os.path import join
 
 from six import string_types
@@ -115,6 +116,8 @@
 
     @classmethod
     def setUpClass(cls):
+        if not os.path.exists('/usr/sbin/slapd'):
+            raise unittest.SkipTest('slapd not found')
         from cubicweb.cwctl import init_cmdline_log_threshold
         init_cmdline_log_threshold(cls.config, cls.loglevel)
         cls._tmpdir = create_slapd_configuration(cls)