diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2021-05-28 14:15:27 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2021-06-11 07:41:38 +0000 |
commit | 79a898e2b717a75004f5c64dfb5adcf28372760b (patch) | |
tree | 5a905c0826868813e56ac526c6a23d71dd1ac976 /lib | |
parent | bb4d06e15e427a69193cc11c2819d2c769cb73de (diff) | |
download | samba-79a898e2b717a75004f5c64dfb5adcf28372760b.tar.gz |
pyldb: Add test for Message.items()
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/ldb/tests/python/api.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py index 940c9051932..16b71e2e650 100755 --- a/lib/ldb/tests/python/api.py +++ b/lib/ldb/tests/python/api.py @@ -3043,6 +3043,27 @@ class LdbMsgTests(TestCase): self.msg.dn = ldb.Dn(ldb.Ldb(), "dc=foo28") self.assertEqual(1, len(self.msg.items())) + def test_items(self): + self.msg["foo"] = ["foo"] + self.msg["bar"] = ["bar"] + try: + items = self.msg.items() + except: + self.fail() + self.assertEqual([("foo", ldb.MessageElement(["foo"])), + ("bar", ldb.MessageElement(["bar"]))], + items) + + self.msg.dn = ldb.Dn(ldb.Ldb(), "dc=test") + try: + items = self.msg.items() + except: + self.fail() + self.assertEqual([("dn", ldb.Dn(ldb.Ldb(), "dc=test")), + ("foo", ldb.MessageElement(["foo"])), + ("bar", ldb.MessageElement(["bar"]))], + items) + def test_repr(self): self.msg.dn = ldb.Dn(ldb.Ldb(), "dc=foo29") self.msg["dc"] = b"foo" |