Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
def _valid_uri(uri):
    if not uri.startswith('ldapfilter://'):
        return True

    ldap_name = uri.replace('ldapfilter://', '', 1)
    ldap_filter = ldap_dao.find_ldapfilter_with_name(ldap_name)
    if not ldap_filter:
        return False

    ldap_server = ldap_dao.find_ldapserver_with_id(ldap_filter.ldapserverid)
    return ldap_server is not None
Ejemplo n.º 4
0
def _valid_uri(uri):
    if not uri.startswith('ldapfilter://'):
        return True

    ldap_name = uri.replace('ldapfilter://', '', 1)
    ldap_filter = ldap_dao.find_ldapfilter_with_name(ldap_name)
    if not ldap_filter:
        return False

    ldap_server = ldap_dao.find_ldapserver_with_id(ldap_filter.ldapserverid)
    return ldap_server is not None