self.msg.dn = ldb.Dn(ldb.Ldb(), "@BASEINFO")
self.msg["foo"] = [b"bla"]
self.msg["bar"] = [b"bla"]
- self.assertEqual(["dn", "foo", "bar"], self.msg.keys())
+ self.assertEqual(["dn", "foo", "bar"], list(self.msg.keys()))
def test_keys_text(self):
self.msg.dn = ldb.Dn(ldb.Ldb(), "@BASEINFO")
self.msg["foo"] = ["bla"]
self.msg["bar"] = ["bla"]
- self.assertEqual(["dn", "foo", "bar"], self.msg.text.keys())
+ self.assertEqual(["dn", "foo", "bar"], list(self.msg.text.keys()))
def test_dn(self):
self.msg.dn = ldb.Dn(ldb.Ldb(), "@BASEINFO")
choices=['yes', 'no', 'auto']),
Option("--color-scheme", help=("use this colour scheme "
"(implies --color=yes)"),
- choices=COLOUR_SETS.keys()),
+ choices=list(COLOUR_SETS.keys())),
Option("-S", "--shorten-names",
help="don't print long common suffixes",
action='store_true', default=False),
scope=SCOPE_SUBTREE)
ok_list = ['dn']
self.assertEquals(len(res), 1)
- res_list = res[0].keys()
+ res_list = list(res[0].keys())
self.assertEquals(res_list, ok_list)
res = self.ldb_user.search("OU=ou2,OU=ou1," + self.base_dn, expression="(objectClass=*)",
scope=SCOPE_BASE, attrs=["ou"])
self.assertEquals(len(res), 1)
- res_list = res[0].keys()
+ res_list = list(res[0].keys())
self.assertEquals(res_list, ok_list)
#give read property on ou and assert user can only see dn and ou
scope=SCOPE_SUBTREE)
ok_list = ['dn', 'ou']
self.assertEquals(len(res), 1)
- res_list = res[0].keys()
+ res_list = list(res[0].keys())
self.assertEquals(sorted(res_list), sorted(ok_list))
#give read property on Public Information and assert user can see ou and other members
scope=SCOPE_SUBTREE)
ok_list = ['dn', 'objectClass', 'ou', 'distinguishedName', 'name', 'objectGUID', 'objectCategory']
- res_list = res[0].keys()
+ res_list = list(res[0].keys())
self.assertEquals(sorted(res_list), sorted(ok_list))
def test_search6(self):
scope=SCOPE_SUBTREE)
self.assertEquals(len(res), 1)
ok_list = ['dn', 'ou']
- res_list = res[0].keys()
+ res_list = list(res[0].keys())
self.assertEquals(sorted(res_list), sorted(ok_list))
#give read property on Public Information and assert user can see ou and other members
scope=SCOPE_SUBTREE)
self.assertEquals(len(res), 1)
ok_list = ['dn', 'objectClass', 'ou', 'distinguishedName', 'name', 'objectGUID', 'objectCategory']
- res_list = res[0].keys()
+ res_list = list(res[0].keys())
self.assertEquals(sorted(res_list), sorted(ok_list))
#tests on ldap delete operations