summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python/deletetest.py
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-18 16:06:46 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-18 17:03:20 +0000
commit4c666f3e0ada47c793ecdec0e5c3dd0441a69080 (patch)
tree1c02a3252fdcadfeb5456b5c158171acafeb9801 /source4/dsdb/tests/python/deletetest.py
parentb7dab4692200dd7f3bbc600560648b8e0ec47e70 (diff)
downloadsamba-4c666f3e0ada47c793ecdec0e5c3dd0441a69080.tar.gz
samba-4c666f3e0ada47c793ecdec0e5c3dd0441a69080.tar.bz2
samba-4c666f3e0ada47c793ecdec0e5c3dd0441a69080.zip
s4:dsdb python tests - use "ldb.domain_dn"
By inspiration of Nadya's patches
Diffstat (limited to 'source4/dsdb/tests/python/deletetest.py')
-rwxr-xr-xsource4/dsdb/tests/python/deletetest.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/source4/dsdb/tests/python/deletetest.py b/source4/dsdb/tests/python/deletetest.py
index 8ed5281a4c..7582d4bef7 100755
--- a/source4/dsdb/tests/python/deletetest.py
+++ b/source4/dsdb/tests/python/deletetest.py
@@ -16,7 +16,7 @@ from samba.auth import system_session
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 import Ldb
+from samba.samdb import SamDB
from subunit.run import SubunitTestRunner
import unittest
@@ -50,12 +50,6 @@ class BasicDeleteTests(unittest.TestCase):
def GUID_string(self, guid):
return self.ldb.schema_format_value("objectGUID", guid)
- def find_basedn(self, ldb):
- res = ldb.search(base="", expression="", scope=SCOPE_BASE,
- attrs=["defaultNamingContext"])
- self.assertEquals(len(res), 1)
- return res[0]["defaultNamingContext"][0]
-
def find_configurationdn(self, ldb):
res = ldb.search(base="", expression="", scope=SCOPE_BASE,
attrs=["configurationNamingContext"])
@@ -64,7 +58,7 @@ class BasicDeleteTests(unittest.TestCase):
def setUp(self):
self.ldb = ldb
- self.base_dn = self.find_basedn(ldb)
+ self.base_dn = ldb.domain_dn()
self.configuration_dn = self.find_configurationdn(ldb)
def search_guid(self, guid):
@@ -395,7 +389,7 @@ if not "://" in host:
else:
host = "ldap://%s" % host
-ldb = Ldb(host, credentials=creds, session_info=system_session(), lp=lp)
+ldb = SamDB(host, credentials=creds, session_info=system_session(), lp=lp)
runner = SubunitTestRunner()
rc = 0