def test_server(self): all_attributes = set( i.ldapDisplayName for i in core.schema_obj(server=config.server, cred=config.cred) if i.Class == "attributeSchema" ) attributes = core.attributes(server=config.server, cred=config.cred) self.assertSetEqual(all_attributes, set(name for name, _ in attributes)) self.assertTrue(all(i.Class == "attributeSchema" for i in attributes))
def test_attributes_not_found(self): with self.assertRaises(exc.AttributeNotFound): list(core.attributes(["does_not_exist"], server=config.server, cred=config.cred))