summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-05-07 04:16:11 +0400
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-07 21:06:23 +0200
commit0c3dfd7a79d48ef5bdcd996537521868e479f1a4 (patch)
treea8f4faa1030c1132729719f38997ba26220fa237
parent1949864417f3d10fb8996df7db259649eb777271 (diff)
downloadsamba-0c3dfd7a79d48ef5bdcd996537521868e479f1a4.tar.gz
samba-0c3dfd7a79d48ef5bdcd996537521868e479f1a4.tar.bz2
samba-0c3dfd7a79d48ef5bdcd996537521868e479f1a4.zip
s4 python: add more unit tests to verify the compare tests
-rwxr-xr-xsource4/lib/ldb/tests/python/api.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/python/api.py b/source4/lib/ldb/tests/python/api.py
index 001739bd53..4d9efb4b67 100755
--- a/source4/lib/ldb/tests/python/api.py
+++ b/source4/lib/ldb/tests/python/api.py
@@ -509,6 +509,25 @@ class LdbMsgTests(unittest.TestCase):
self.assertRaises(KeyError, lambda: msgdiff["foo"])
self.assertEquals(1, len(msgdiff))
+ def test_equal_empty(self):
+ msg1 = ldb.Message()
+ msg2 = ldb.Message()
+ self.assertEquals(msg1, msg2)
+
+ def test_equal_simplel(self):
+ db = ldb.Ldb("foo.tdb")
+ msg1 = ldb.Message()
+ msg1.dn = ldb.Dn(db, "foo=bar")
+ msg2 = ldb.Message()
+ msg2.dn = ldb.Dn(db, "foo=bar")
+ self.assertEquals(msg1, msg2)
+ msg1['foo'] = 'bar'
+ msg2['foo'] = 'bar'
+ self.assertEquals(msg1, msg2)
+ msg2['foo'] = 'blie'
+ self.assertNotEquals(msg1, msg2)
+ msg2['foo'] = 'blie'
+
class MessageElementTests(unittest.TestCase):