mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-29 09:35:50 +00:00
36 lines
960 B
Python
36 lines
960 B
Python
|
|
# -*- coding: utf-8 -*-
|
|
'''
|
|
vdirsyncer.tests.storage.dav
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
:copyright: (c) 2014 Markus Unterwaditzer
|
|
:license: MIT, see LICENSE for more details.
|
|
'''
|
|
|
|
import os
|
|
|
|
from .. import StorageTests
|
|
import vdirsyncer.exceptions as exceptions
|
|
from vdirsyncer.storage.base import Item
|
|
import requests.exceptions
|
|
|
|
|
|
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, requests.exceptions.HTTPError):
|
|
pass
|
|
assert not list(s.list())
|