summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadezhda Ivanova <nivanova@samba.org>2010-11-24 17:47:27 +0200
committerNadezhda Ivanova <nivanova@samba.org>2010-11-25 01:09:27 +0200
commitdb5bcb7115991bb1289cad471190fd73139ea53e (patch)
tree6a1f0e977249480353f148ce71b667c41d1d7bd7
parent64424bb1c3a1714371cf7dd9d2e0ff52777b7874 (diff)
downloadsamba-db5bcb7115991bb1289cad471190fd73139ea53e.tar.gz
samba-db5bcb7115991bb1289cad471190fd73139ea53e.tar.bz2
samba-db5bcb7115991bb1289cad471190fd73139ea53e.zip
s4-tests: Added a common definition of delete_force.
-rw-r--r--source4/scripting/python/samba/tests/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py
index 0519fd8dc5..2248292b89 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -175,3 +175,9 @@ def connect_samdb_ex(samdb_url, lp=None, session_info=None,
# fetch RootDse
res = sam_db.search(base="", expression="", scope=ldb.SCOPE_BASE, attrs=["*"])
return (sam_db, res[0])
+
+def delete_force(samdb, dn):
+ try:
+ samdb.delete(dn)
+ except ldb.LdbError, (num, _):
+ assert(num == ldb.ERR_NO_SUCH_OBJECT)