PEP8: fix E201: whitespace after '('
[samba.git] / python / samba / tests / __init__.py
index 1d50710209523337abd1836618eea182b6c0ee0a..a3caba6472c63137aa52accc75a1c5d31a98211e 100644 (file)
@@ -38,7 +38,14 @@ import samba.dcerpc.base
 from samba.compat import PY3, text_type
 from samba.compat import string_types
 from random import randint
-from samba.samdb import SamDB
+try:
+    from samba.samdb import SamDB
+except ImportError:
+    # We are built without samdb support,
+    # imitate it so that connect_samdb() can recover
+    def SamDB(*args, **kwargs):
+        return None
+
 import samba.ndr
 import samba.dcerpc.dcerpc
 import samba.dcerpc.epmapper
@@ -245,7 +252,7 @@ class TestCase(unittest.TestCase):
                              "a diff follows\n"
                              % ('when stripped ' if strip else '',
                                 len(a), len(b),
-                             ))
+                                ))
 
             from difflib import unified_diff
             diff = unified_diff(a.splitlines(True),
@@ -492,5 +499,5 @@ def create_test_ou(samdb, name):
     # testenv may still exist at the point that tests start on another testenv.
     rand = randint(1, 10000000)
     dn = ldb.Dn(samdb, "OU=%s%d,%s" %(name, rand, samdb.get_default_basedn()))
-    samdb.add({ "dn": dn, "objectclass": "organizationalUnit"})
+    samdb.add({"dn": dn, "objectclass": "organizationalUnit"})
     return dn