summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorNadezhda Ivanova <nivanova@samba.org>2010-11-25 01:12:42 +0200
committerNadezhda Ivanova <nivanova@samba.org>2010-11-25 01:12:42 +0200
commit5e7d99a5d84dfc723c9be26cb7617307aaa2fb23 (patch)
treee3ec2ea193dc262a2b89fc233e74099212413e76 /source4
parentd21d3e7db8e9b05daa17ca0e84b1b7f82b55a80e (diff)
downloadsamba-5e7d99a5d84dfc723c9be26cb7617307aaa2fb23.tar.gz
samba-5e7d99a5d84dfc723c9be26cb7617307aaa2fb23.tar.bz2
samba-5e7d99a5d84dfc723c9be26cb7617307aaa2fb23.zip
s4-tests: Modified ldap_schema.py to use samba.tests.delete_force
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/dsdb/tests/python/ldap_schema.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/source4/dsdb/tests/python/ldap_schema.py b/source4/dsdb/tests/python/ldap_schema.py
index bc7069e999..64da563e22 100755
--- a/source4/dsdb/tests/python/ldap_schema.py
+++ b/source4/dsdb/tests/python/ldap_schema.py
@@ -24,6 +24,7 @@ from ldb import Message, MessageElement, Dn
from ldb import FLAG_MOD_REPLACE
from samba.samdb import SamDB
from samba.dsdb import DS_DOMAIN_FUNCTION_2003
+from samba.tests import delete_force
from subunit.run import SubunitTestRunner
import unittest
@@ -49,12 +50,6 @@ creds = credopts.get_credentials(lp)
class SchemaTests(unittest.TestCase):
- def delete_force(self, ldb, dn):
- try:
- ldb.delete(dn)
- except LdbError, (num, _):
- self.assertEquals(num, ERR_NO_SUCH_OBJECT)
-
def setUp(self):
super(SchemaTests, self).setUp()
self.ldb = ldb
@@ -192,7 +187,7 @@ name: """ + object_name + """
res = self.ldb.search("cn=%s,cn=Users,%s" % (object_name, self.base_dn), scope=SCOPE_BASE, attrs=["*"])
self.assertEquals(len(res), 1)
# Delete the object
- self.delete_force(self.ldb, "cn=%s,cn=Users,%s" % (object_name, self.base_dn))
+ delete_force(self.ldb, "cn=%s,cn=Users,%s" % (object_name, self.base_dn))
def test_subClassOf(self):
""" Testing usage of custom child schamaClass
@@ -248,7 +243,7 @@ instanceType: 4
res = self.ldb.search("ou=%s,%s" % (object_name, self.base_dn), scope=SCOPE_BASE, attrs=["*"])
self.assertEquals(len(res), 1)
# Delete the object
- self.delete_force(self.ldb, "ou=%s,%s" % (object_name, self.base_dn))
+ delete_force(self.ldb, "ou=%s,%s" % (object_name, self.base_dn))
class SchemaTests_msDS_IntId(unittest.TestCase):