summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorNadezhda Ivanova <nivanova@samba.org>2010-11-25 01:11:57 +0200
committerNadezhda Ivanova <nivanova@samba.org>2010-11-25 01:11:57 +0200
commit66aa40b9d942664722f113f07d6024529da1fb14 (patch)
treed2c10acea61f20b76a551bd6f16a737c31371196 /source4
parentf42802e22fa0f0a2026036d540cd5f3341870557 (diff)
downloadsamba-66aa40b9d942664722f113f07d6024529da1fb14.tar.gz
samba-66aa40b9d942664722f113f07d6024529da1fb14.tar.bz2
samba-66aa40b9d942664722f113f07d6024529da1fb14.zip
s4-tests: Modified deletetest.py to use samba.tests.delete_force
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/dsdb/tests/python/deletetest.py32
1 files changed, 14 insertions, 18 deletions
diff --git a/source4/dsdb/tests/python/deletetest.py b/source4/dsdb/tests/python/deletetest.py
index aec6b8c2e8..4ed125dd8f 100755
--- a/source4/dsdb/tests/python/deletetest.py
+++ b/source4/dsdb/tests/python/deletetest.py
@@ -17,6 +17,7 @@ from ldb import SCOPE_BASE, LdbError
from ldb import ERR_NO_SUCH_OBJECT, ERR_NOT_ALLOWED_ON_NON_LEAF
from ldb import ERR_UNWILLING_TO_PERFORM
from samba.samdb import SamDB
+from samba.tests import delete_force
from subunit.run import SubunitTestRunner
import unittest
@@ -41,11 +42,6 @@ creds = credopts.get_credentials(lp)
class BasicDeleteTests(unittest.TestCase):
- def delete_force(self, ldb, dn):
- try:
- ldb.delete(dn)
- except LdbError, (num, _):
- self.assertEquals(num, ERR_NO_SUCH_OBJECT)
def GUID_string(self, guid):
return self.ldb.schema_format_value("objectGUID", guid)
@@ -118,9 +114,9 @@ class BasicDeleteTests(unittest.TestCase):
print self.base_dn
- self.delete_force(self.ldb, "cn=entry1,cn=ldaptestcontainer," + self.base_dn)
- self.delete_force(self.ldb, "cn=entry2,cn=ldaptestcontainer," + self.base_dn)
- self.delete_force(self.ldb, "cn=ldaptestcontainer," + self.base_dn)
+ delete_force(self.ldb, "cn=entry1,cn=ldaptestcontainer," + self.base_dn)
+ delete_force(self.ldb, "cn=entry2,cn=ldaptestcontainer," + self.base_dn)
+ delete_force(self.ldb, "cn=ldaptestcontainer," + self.base_dn)
ldb.add({
"dn": "cn=ldaptestcontainer," + self.base_dn,
@@ -159,9 +155,9 @@ class BasicDeleteTests(unittest.TestCase):
except LdbError, (num, _):
self.assertEquals(num, ERR_NO_SUCH_OBJECT)
- self.delete_force(self.ldb, "cn=entry1,cn=ldaptestcontainer," + self.base_dn)
- self.delete_force(self.ldb, "cn=entry2,cn=ldaptestcontainer," + self.base_dn)
- self.delete_force(self.ldb, "cn=ldaptestcontainer," + self.base_dn)
+ delete_force(self.ldb, "cn=entry1,cn=ldaptestcontainer," + self.base_dn)
+ delete_force(self.ldb, "cn=entry2,cn=ldaptestcontainer," + self.base_dn)
+ delete_force(self.ldb, "cn=ldaptestcontainer," + self.base_dn)
# Performs some protected object delete testing
@@ -258,13 +254,13 @@ class BasicDeleteTests(unittest.TestCase):
srv1="cn=Servers,cn=testsite1,cn=sites," + self.configuration_dn
srv2="cn=TESTSRV,cn=Servers,cn=testsite1,cn=sites," + self.configuration_dn
- self.delete_force(self.ldb, usr1)
- self.delete_force(self.ldb, usr2)
- self.delete_force(self.ldb, grp1)
- self.delete_force(self.ldb, ss1)
- self.delete_force(self.ldb, srv2)
- self.delete_force(self.ldb, srv1)
- self.delete_force(self.ldb, sit1)
+ delete_force(self.ldb, usr1)
+ delete_force(self.ldb, usr2)
+ delete_force(self.ldb, grp1)
+ delete_force(self.ldb, ss1)
+ delete_force(self.ldb, srv2)
+ delete_force(self.ldb, srv1)
+ delete_force(self.ldb, sit1)
ldb.add({
"dn": usr1,