test: fixed several tests to use samba.tests
authorAndrew Tridgell <tridge@samba.org>
Wed, 9 Nov 2011 02:28:02 +0000 (13:28 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Nov 2011 03:24:21 +0000 (14:24 +1100)
this fixes error checking. Test failures were not being detected
otherwise

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

auth/credentials/tests/bind.py
source4/dsdb/tests/python/deletetest.py
source4/dsdb/tests/python/ldap.py
source4/dsdb/tests/python/ldap_schema.py
source4/dsdb/tests/python/ldap_syntaxes.py
source4/dsdb/tests/python/sam.py
source4/lib/policy/tests/python/bindings.py

index 1529a47..aa4b17a 100755 (executable)
@@ -25,10 +25,10 @@ from samba.auth import system_session
 from samba import gensec
 from samba.samdb import SamDB
 from samba.credentials import Credentials
-import samba.tests
+import samba.tests, unittest
 from samba.tests import delete_force
 from subunit.run import SubunitTestRunner
-import unittest
+from samba.tests import TestCase, TestSkipped
 
 parser = optparse.OptionParser("ldap [options] <host>")
 sambaopts = options.SambaOptions(parser)
index 80c6937..ce972ab 100755 (executable)
@@ -40,13 +40,14 @@ host = args[0]
 lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 
-class BasicDeleteTests(unittest.TestCase):
+class BasicDeleteTests(samba.tests.TestCase):
 
 
     def GUID_string(self, guid):
         return self.ldb.schema_format_value("objectGUID", guid)
 
     def setUp(self):
+        super(BasicDeleteTests, self).setUp()
         self.ldb = ldb
         self.base_dn = ldb.domain_dn()
         self.configuration_dn = ldb.get_config_basedn().get_linearized()
index 9009c74..61443ef 100755 (executable)
@@ -60,7 +60,7 @@ host = args[0]
 lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 
-class BasicTests(unittest.TestCase):
+class BasicTests(samba.tests.TestCase):
 
     def setUp(self):
         super(BasicTests, self).setUp()
@@ -2768,7 +2768,7 @@ nTSecurityDescriptor:: """ + desc_base64
         self.assertTrue("whenCreated" in res[0])
         self.assertTrue("whenChanged" in res[0])
 
-class BaseDnTests(unittest.TestCase):
+class BaseDnTests(samba.tests.TestCase):
 
     def setUp(self):
         super(BaseDnTests, self).setUp()
index a6503e2..5de0479 100755 (executable)
@@ -48,7 +48,7 @@ lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 
 
-class SchemaTests(unittest.TestCase):
+class SchemaTests(samba.tests.TestCase):
 
     def setUp(self):
         super(SchemaTests, self).setUp()
@@ -246,7 +246,7 @@ instanceType: 4
         delete_force(self.ldb, "ou=%s,%s" % (object_name, self.base_dn))
 
 
-class SchemaTests_msDS_IntId(unittest.TestCase):
+class SchemaTests_msDS_IntId(samba.tests.TestCase):
 
     def setUp(self):
         super(SchemaTests_msDS_IntId, self).setUp()
@@ -518,7 +518,7 @@ systemOnly: FALSE
                 self.assertTrue("msDS-IntId" not in ldb_msg)
 
 
-class SchemaTests_msDS_isRODC(unittest.TestCase):
+class SchemaTests_msDS_isRODC(samba.tests.TestCase):
 
     def setUp(self):
         super(SchemaTests_msDS_isRODC, self).setUp()
index 64e0c42..ad89cb1 100644 (file)
@@ -44,7 +44,7 @@ lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 
 
-class SyntaxTests(unittest.TestCase):
+class SyntaxTests(samba.tests.TestCase):
 
     def setUp(self):
         super(SyntaxTests, self).setUp()
index b08fba5..7f5b74d 100755 (executable)
@@ -63,7 +63,7 @@ host = args[0]
 lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 
-class SamTests(unittest.TestCase):
+class SamTests(samba.tests.TestCase):
 
     def setUp(self):
         super(SamTests, self).setUp()
index b872d99..afe8519 100644 (file)
 
 """
 
-import unittest
+import samba
 from samba import policy
 
-class PolicyTests(unittest.TestCase):
+class PolicyTests(samba.tests.TestCase):
 
     def test_get_gpo_flags(self):
         self.assertEquals(["GPO_FLAG_USER_DISABLE"],