<commit_before>
# -*- coding: utf-8 -*-
'''
    vdirsyncer.tests.storage.dav
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: (c) 2014 <NAME>
    :license: MIT, see LICENSE for more details.
'''

import sys
import os
import urlparse
import tempfile
import shutil
import mock

from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse as WerkzeugResponse

from .. import StorageTests
import vdirsyncer.exceptions as exceptions
from vdirsyncer.storage.base import Item


dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale'
if dav_server in ('radicale', 'radicale_git'):
    from ._radicale import ServerMixin
elif dav_server == 'owncloud':
    from ._owncloud import ServerMixin
else:
    raise RuntimeError('{} is not a known DAV server.'.format(dav_server))


class DavStorageTests(ServerMixin, StorageTests):
    def test_dav_broken_item(self):
        item = Item(u'UID:1')
        s = self._get_storage()
        try:
            s.upload(item)
        except exceptions.Error:
            pass
        assert not list(s.list())
<commit_msg>Owncloud isn't even available<commit_after>
# -*- coding: utf-8 -*-
'''
    vdirsyncer.tests.storage.dav
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: (c) 2014 <NAME>
    :license: MIT, see LICENSE for more details.
'''

import sys
import os
import urlparse
import tempfile
import shutil
import mock

from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse as WerkzeugResponse

from .. import StorageTests
import vdirsyncer.exceptions as exceptions
from vdirsyncer.storage.base import Item


dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale'
if dav_server in ('radicale', 'radicale_git'):
    from ._radicale import ServerMixin
else:
    raise RuntimeError('{} is not a known DAV server.'.format(dav_server))


class DavStorageTests(ServerMixin, StorageTests):
    def test_dav_broken_item(self):
        item = Item(u'UID:1')
        s = self._get_storage()
        try:
            s.upload(item)
        except exceptions.Error:
            pass
        assert not list(s.list())

{'fraction_non_alphanumeric': 0.12595057034220533, 'fraction_numerical': 0.005703422053231939, 'mean_word_length': 3.5268817204301075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5691964', 'n_tokens_mistral': 662, 'n_tokens_neox': 644, 'n_words': 186}