diff options
author | Matthieu Patou <mat@matws.net> | 2010-05-07 04:16:11 +0400 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-06-07 21:06:23 +0200 |
commit | 0c3dfd7a79d48ef5bdcd996537521868e479f1a4 (patch) | |
tree | a8f4faa1030c1132729719f38997ba26220fa237 /source4/lib/ldb/tests/python | |
parent | 1949864417f3d10fb8996df7db259649eb777271 (diff) | |
download | samba-0c3dfd7a79d48ef5bdcd996537521868e479f1a4.tar.gz samba-0c3dfd7a79d48ef5bdcd996537521868e479f1a4.tar.bz2 samba-0c3dfd7a79d48ef5bdcd996537521868e479f1a4.zip |
s4 python: add more unit tests to verify the compare tests
Diffstat (limited to 'source4/lib/ldb/tests/python')
-rwxr-xr-x | source4/lib/ldb/tests/python/api.py | 19 |
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): |