diff options
author | Matthieu Patou <mat@matws.net> | 2011-06-11 18:31:28 +0400 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-07-21 11:44:34 +1000 |
commit | 3f6df9f9e33266ba2f383dde17ed6f9de7dd54c9 (patch) | |
tree | 8351a6bcdc5cab9426f75d93640130eebd5b03fc | |
parent | 521556ceed19fdba534e05859b7372c2422c7d98 (diff) | |
download | samba-3f6df9f9e33266ba2f383dde17ed6f9de7dd54c9.tar.gz samba-3f6df9f9e33266ba2f383dde17ed6f9de7dd54c9.tar.bz2 samba-3f6df9f9e33266ba2f383dde17ed6f9de7dd54c9.zip |
pyldb: add unit test for ldbDn.compare_base
-rwxr-xr-x | lib/ldb/tests/python/api.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py index e7658d51ab..bc556d6143 100755 --- a/lib/ldb/tests/python/api.py +++ b/lib/ldb/tests/python/api.py @@ -437,6 +437,17 @@ class DnTests(unittest.TestCase): x = ldb.Dn(self.ldb, "dc=foo26,bar=bloe") self.assertEquals("/bloe\nfoo26", x.canonical_ex_str()) + def test_ldb_base_compare(self): + """Testing ldb_dn_compare_dn""" + dn1 = ldb.Dn(self.ldb, "dc=base") + dn2 = ldb.Dn(self.ldb, "cn=foo,dc=base") + dn3 = ldb.Dn(self.ldb, "cn=bar,dc=base") + dn4 = ldb.Dn(self.ldb, "cn=baz,cn=bar,dc=base") + + self.assertEquals(0, dn2.compare_base(dn1)) + self.assertEquals(0, dn4.compare_base(dn1)) + self.assertEquals(0, dn4.compare_base(dn3)) + self.assertFalse(dn3.compare_base(dn2) == 0) class LdbMsgTests(unittest.TestCase): |