def test_valid_uri_no_server(self, find_ldapfilter_with_name):
        ldap_name = 'test-ldap-filter'
        find_ldapfilter_with_name.return_value = None

        valid_uri = cti_directories_dao._valid_uri("ldapfilter://%s" % ldap_name)

        assert_that(valid_uri, equal_to(False))
        find_ldapfilter_with_name.assert_called_once_with(ldap_name)
Exemplo n.º 2
0
    def test_valid_uri_no_server(self, find_ldapfilter_with_name):
        ldap_name = 'test-ldap-filter'
        find_ldapfilter_with_name.return_value = None

        valid_uri = cti_directories_dao._valid_uri("ldapfilter://%s" % ldap_name)

        assert_that(valid_uri, equal_to(False))
        find_ldapfilter_with_name.assert_called_once_with(ldap_name)
    def test_valid_uri_with_server(self, find_ldapfilter_with_name, find_ldapserver_with_id):
        ldap_name = 'foo-server'
        ldapserverid = 1
        find_ldapfilter_with_name.return_value = Mock(ldapserverid=ldapserverid)
        find_ldapserver_with_id.return_value = Mock()

        valid_uri = cti_directories_dao._valid_uri("ldapfilter://%s" % ldap_name)
        find_ldapserver_with_id.assert_called_once_with(ldapserverid)

        assert_that(valid_uri, equal_to(True))
Exemplo n.º 4
0
    def test_valid_uri_with_server(self, find_ldapfilter_with_name, find_ldapserver_with_id):
        ldap_name = 'foo-server'
        ldapserverid = 1
        find_ldapfilter_with_name.return_value = Mock(ldapserverid=ldapserverid)
        find_ldapserver_with_id.return_value = Mock()

        valid_uri = cti_directories_dao._valid_uri("ldapfilter://%s" % ldap_name)
        find_ldapserver_with_id.assert_called_once_with(ldapserverid)

        assert_that(valid_uri, equal_to(True))
    def test_valid_uri_normal_uri(self):
        uri = "internal"

        valid_uri = cti_directories_dao._valid_uri(uri)

        assert_that(valid_uri, equal_to(True))
Exemplo n.º 6
0
    def test_valid_uri_normal_uri(self):
        uri = "internal"

        valid_uri = cti_directories_dao._valid_uri(uri)

        assert_that(valid_uri, equal_to(True))