mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Add tests
This commit is contained in:
parent
6ceeb99f4a
commit
87baac535d
2 changed files with 37 additions and 1 deletions
3
Makefile
3
Makefile
|
|
@ -12,6 +12,7 @@
|
||||||
# make DAV_SERVER=skip # ...
|
# make DAV_SERVER=skip # ...
|
||||||
|
|
||||||
export DAV_SERVER := radicale
|
export DAV_SERVER := radicale
|
||||||
|
export REMOTESTORAGE_SERVER := restore
|
||||||
export RADICALE_BACKEND := filesystem
|
export RADICALE_BACKEND := filesystem
|
||||||
export REQUIREMENTS := release
|
export REQUIREMENTS := release
|
||||||
export TESTSERVER_BASE := ./tests/storage/servers/
|
export TESTSERVER_BASE := ./tests/storage/servers/
|
||||||
|
|
@ -19,7 +20,7 @@ export TRAVIS := false
|
||||||
|
|
||||||
install-servers:
|
install-servers:
|
||||||
set -ex; \
|
set -ex; \
|
||||||
for server in $(DAV_SERVER); do \
|
for server in $(DAV_SERVER) $(REMOTESTORAGE_SERVER); do \
|
||||||
if [ ! -d "$(TESTSERVER_BASE)$$server/" ]; then \
|
if [ ! -d "$(TESTSERVER_BASE)$$server/" ]; then \
|
||||||
git clone --depth=1 \
|
git clone --depth=1 \
|
||||||
https://github.com/vdirsyncer/$$server-testserver.git \
|
https://github.com/vdirsyncer/$$server-testserver.git \
|
||||||
|
|
|
||||||
35
tests/storage/test_remotestorage.py
Normal file
35
tests/storage/test_remotestorage.py
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from vdirsyncer.storage.remotestorage import \
|
||||||
|
RemoteStorageCalendars, RemoteStorageContacts
|
||||||
|
|
||||||
|
from . import StorageTests, get_server_mixin
|
||||||
|
|
||||||
|
remotestorage_server = os.environ['REMOTESTORAGE_SERVER']
|
||||||
|
ServerMixin = get_server_mixin(remotestorage_server)
|
||||||
|
|
||||||
|
|
||||||
|
class RemoteStorageTests(ServerMixin, StorageTests):
|
||||||
|
remotestorage_server = remotestorage_server
|
||||||
|
|
||||||
|
|
||||||
|
class TestCalendars(RemoteStorageTests):
|
||||||
|
storage_class = RemoteStorageCalendars
|
||||||
|
|
||||||
|
@pytest.fixture(params=['VTODO', 'VEVENT'])
|
||||||
|
def item_type(self, request):
|
||||||
|
return request.param
|
||||||
|
|
||||||
|
|
||||||
|
class TestContacts(RemoteStorageTests):
|
||||||
|
storage_class = RemoteStorageContacts
|
||||||
|
supports_collections = False
|
||||||
|
|
||||||
|
@pytest.fixture(params=['VCARD'])
|
||||||
|
def item_type(self, request):
|
||||||
|
return request.param
|
||||||
Loading…
Reference in a new issue