s4-tests: Modified bind.py to use samba.tests.delete_force
authorNadezhda Ivanova <nivanova@samba.org>
Wed, 24 Nov 2010 23:11:29 +0000 (01:11 +0200)
committerNadezhda Ivanova <nivanova@samba.org>
Wed, 24 Nov 2010 23:11:29 +0000 (01:11 +0200)
source4/auth/credentials/tests/bind.py

index c59e714a88a901dd06379981f1127b5ec4590beb..8c93319ccd561129ad4d566d9e80fa853e06aeb9 100755 (executable)
@@ -26,6 +26,7 @@ from samba import gensec
 from samba.samdb import SamDB
 from samba.credentials import Credentials
 import samba.tests
+from samba.tests import delete_force
 from subunit.run import SubunitTestRunner
 import unittest
 
@@ -70,18 +71,12 @@ class BindTests(samba.tests.TestCase):
         self.password = "P@ssw0rd"
         self.username = "BindTestUser_" + time.strftime("%s", time.gmtime())
 
-    def delete_force(self, ldb, dn):
-        try:
-            ldb.delete(dn)
-        except LdbError, (num, _):
-            self.assertEquals(num, ERR_NO_SUCH_OBJECT)
-
     def tearDown(self):
         super(BindTests, self).tearDown()
 
     def test_computer_account_bind(self):
         # create a computer acocount for the test
-        self.delete_force(ldb, self.computer_dn)
+        delete_force(ldb, self.computer_dn)
         ldb.add_ldif("""
 dn: """ + self.computer_dn + """
 cn: CENTOS53