Commit 0a7d4b51 authored by Pascal Cadotte Michaud's avatar Pascal Cadotte Michaud Committed by Etienne Lessard

ldap_dao: remove unused code

parent 9c97ad5a
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2015 Avencall
# Copyright (C) 2012-2016 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -20,16 +20,6 @@ from xivo_dao.alchemy.ldapfilter import LdapFilter
from xivo_dao.alchemy.ldapserver import LdapServer
@daosession
def find_ldapfilter_with_name(session, ldap_name):
return session.query(LdapFilter).filter(LdapFilter.name == ldap_name).first()
@daosession
def find_ldapserver_with_id(session, ldapserver_id):
return session.query(LdapServer).filter(LdapServer.id == ldapserver_id).first()
@daosession
def build_ldapinfo_from_ldapfilter(session, ldap_filter_name):
ldap_config = session.query(
......
# -*- coding: utf-8 -*-
# Copyright (C) 2013-2015 Avencall
# Copyright (C) 2013-2016 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -26,21 +26,6 @@ from xivo_dao.tests.test_dao import DAOTestCase
class TestLdapDAO(DAOTestCase):
def test_find_ldapserver_with_id(self):
ldapserver = self._insert_ldapserver(name='ldapserver_test')
ldapserver_result = ldap_dao.find_ldapserver_with_id(ldapserver.id)
self.assertEqual(ldapserver.id, ldapserver_result.id)
def test_find_ldapfilter_with_name(self):
ldapserver = self._insert_ldapserver(name='ldapserver_test')
ldapfilter = self._insert_ldapfilter(ldapserver.id, name='ldapfilter_test')
ldapfilter_result = ldap_dao.find_ldapfilter_with_name(ldapfilter.name)
self.assertEqual(ldapfilter.name, ldapfilter_result.name)
def test_build_ldapinfo_from_ldapfilter_not_found(self):
self.assertRaises(LookupError, ldap_dao.build_ldapinfo_from_ldapfilter, 'unknown')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment