mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Add item_types test
This commit is contained in:
parent
8933da7db4
commit
40b64139fd
3 changed files with 15 additions and 4 deletions
|
|
@ -116,7 +116,7 @@ class ServerMixin(object):
|
||||||
'collection': collection, 'unsafe_href_chars': ''}
|
'collection': collection, 'unsafe_href_chars': ''}
|
||||||
|
|
||||||
if collection is not None:
|
if collection is not None:
|
||||||
# Create collection, works around
|
# XXX: Create collection, works around
|
||||||
# https://github.com/Kozea/Radicale/pull/236
|
# https://github.com/Kozea/Radicale/pull/236
|
||||||
s = self.storage_class(**rv)
|
s = self.storage_class(**rv)
|
||||||
s.delete(*s.upload(get_item()))
|
s.delete(*s.upload(get_item()))
|
||||||
|
|
|
||||||
|
|
@ -175,10 +175,22 @@ class TestCaldavStorage(DavStorageTests):
|
||||||
list(s.list())
|
list(s.list())
|
||||||
assert len(calls) == 1
|
assert len(calls) == 1
|
||||||
|
|
||||||
|
def test_item_types(self, s):
|
||||||
|
event = s.upload(format_item(EVENT_TEMPLATE))
|
||||||
|
task = s.upload(format_item(TASK_TEMPLATE))
|
||||||
|
s.item_types = ('VTODO', 'VEVENT')
|
||||||
|
assert set(s.list()) == set([event, task])
|
||||||
|
s.item_types = ('VTODO',)
|
||||||
|
assert set(s.list()) == set([task])
|
||||||
|
s.item_types = ('VEVENT',)
|
||||||
|
assert set(s.list()) == set([event])
|
||||||
|
s.item_types = ()
|
||||||
|
assert set(s.list()) == set([event, task])
|
||||||
|
|
||||||
|
|
||||||
class TestCarddavStorage(DavStorageTests):
|
class TestCarddavStorage(DavStorageTests):
|
||||||
storage_class = CarddavStorage
|
storage_class = CarddavStorage
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def item_template(self, request):
|
def item_template(self):
|
||||||
return VCARD_TEMPLATE
|
return VCARD_TEMPLATE
|
||||||
|
|
|
||||||
|
|
@ -496,8 +496,7 @@ class CaldavStorage(DavStorage):
|
||||||
:param end_date: End date of timerange to show, default +inf.
|
:param end_date: End date of timerange to show, default +inf.
|
||||||
:param item_types: Comma-separated collection types to show from the
|
:param item_types: Comma-separated collection types to show from the
|
||||||
server. Dependent on server functionality, no clientside validation of
|
server. Dependent on server functionality, no clientside validation of
|
||||||
results. The empty value ``''`` is the same as ``'VTODO, VEVENT,
|
results. The empty value ``[]`` means "all items".
|
||||||
VJOURNAL'``.
|
|
||||||
''' + DavStorage.__doc__
|
''' + DavStorage.__doc__
|
||||||
|
|
||||||
storage_name = 'caldav'
|
storage_name = 'caldav'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue