vdirsyncer/tests/storage/servers/radicale/__init__.py
Hugo Osvaldo Barrera 299c699cb9 Manage test DAV servers as fixtures
Rather than require manually starting them before tests, manage them as
fixtures an initialise/destroy them as needed.
2021-06-12 16:28:24 +02:00

25 lines
586 B
Python

import pytest
class ServerMixin:
@pytest.fixture
def get_storage_args(
self,
request,
tmpdir,
slow_create_collection,
radicale_server,
):
def inner(collection="test"):
url = "http://127.0.0.1:8001/"
args = {
"url": url,
"username": "radicale",
"password": "radicale",
}
if collection is not None:
args = slow_create_collection(self.storage_class, args, collection)
return args
return inner