From: Nadezhda Ivanova Date: Wed, 24 Nov 2010 23:11:29 +0000 (+0200) Subject: s4-tests: Modified bind.py to use samba.tests.delete_force X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=f42802e22fa0f0a2026036d540cd5f3341870557;p=metze%2Fsamba%2Fwip.git s4-tests: Modified bind.py to use samba.tests.delete_force --- diff --git a/source4/auth/credentials/tests/bind.py b/source4/auth/credentials/tests/bind.py index c59e714a88a9..8c93319ccd56 100755 --- a/source4/auth/credentials/tests/bind.py +++ b/source4/auth/credentials/tests/bind.py @@ -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