summaryrefslogtreecommitdiff
path: root/source4/scripting/swig/torture/torture_ldb.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-11-21 12:31:43 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:45:56 +0100
commite5e2b64449a476552bbad49792b13f7501ecdc0c (patch)
tree528f291f764f78a4e06d31587c8129e350c27668 /source4/scripting/swig/torture/torture_ldb.py
parentd1d958caa1be1f0fe1769dc563e15e9a65851459 (diff)
downloadsamba-e5e2b64449a476552bbad49792b13f7501ecdc0c.tar.gz
samba-e5e2b64449a476552bbad49792b13f7501ecdc0c.tar.bz2
samba-e5e2b64449a476552bbad49792b13f7501ecdc0c.zip
r26079: Some cleanups in the old SWIG wrappers: - remove old torture tests for LDB (replaced by a much more extensive test) - moved tool to bin directory
(This used to be commit d6d3b0ad7a789441c82cf30a640033a052921c37)
Diffstat (limited to 'source4/scripting/swig/torture/torture_ldb.py')
-rwxr-xr-xsource4/scripting/swig/torture/torture_ldb.py83
1 files changed, 0 insertions, 83 deletions
diff --git a/source4/scripting/swig/torture/torture_ldb.py b/source4/scripting/swig/torture/torture_ldb.py
deleted file mode 100755
index fe79f4f843..0000000000
--- a/source4/scripting/swig/torture/torture_ldb.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/python
-#
-# A torture test for the Python Ldb bindings. Also a short guide on
-# how the API works.
-#
-
-from Ldb import *
-
-# Helpers
-
-def t(cond, msg):
- """Test a condition."""
- if not cond:
- raise RuntimeError('FAILED: %s' % msg)
-
-#
-# Torture LdbMessage
-#
-
-m = LdbMessage()
-
-# Empty message
-
-t(m.keys() == [], 'empty msg')
-t(m.dn == None, 'empty dn')
-
-t(m.sanity_check() == LDB_ERR_INVALID_DN_SYNTAX, 'sanity check')
-
-# Test invalid dn
-
-try:
- m.dn = 'invalid dn'
-except LdbError, arg:
- if arg[0] != LDB_ERR_INVALID_DN_SYNTAX:
- raise
-else:
- t(False, 'LdbError not raised')
-
-# Test valid dn
-
-m.dn = 'name=spotty'
-t(m.dn == 'name=spotty', 'specified dn')
-
-t(m.sanity_check() == LDB_SUCCESS, 'sanity check')
-
-# Test some single-valued attributes
-
-m['animal'] = 'dog'
-m['name'] = 'spotty'
-
-t(m.keys() == ['animal', 'name'], 'keys() test failed')
-t(m.values() == [['dog'], ['spotty']], 'values() test failed')
-t(m.items() == [('animal', ['dog']), ('name', ['spotty'])],
- 'items() test failed')
-
-t(m.sanity_check() == LDB_SUCCESS, 'sanity check')
-
-m['animal'] = 'canine'
-t(m['animal'] == ['canine'], 'replace value failed')
-
-# Test a multi-valued attribute
-
-names = ['spotty', 'foot']
-m['name'] = names
-
-t(m['name'] == names, 'multi-valued attr failed')
-
-t(m.sanity_check() == LDB_SUCCESS, 'sanity check')
-
-# Test non-string attributes
-
-try:
- m['foo'] = 42
-except TypeError:
- pass
-else:
- t(False, 'TypeError not raised')
-
-#
-# Torture Ldb
-#
-
-l = Ldb('foo.ldb')