mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-24 14:27:41 +00:00
Rather than require manually starting them before tests, manage them as fixtures an initialise/destroy them as needed.
21 lines
475 B
Python
21 lines
475 B
Python
import pytest
|
|
|
|
|
|
class ServerMixin:
|
|
@pytest.fixture
|
|
def get_storage_args(
|
|
self,
|
|
request,
|
|
tmpdir,
|
|
slow_create_collection,
|
|
xandikos_server,
|
|
):
|
|
def inner(collection="test"):
|
|
url = "http://127.0.0.1:8000/"
|
|
args = {"url": url}
|
|
|
|
if collection is not None:
|
|
args = slow_create_collection(self.storage_class, args, collection)
|
|
return args
|
|
|
|
return inner
|