mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Add asyncio to the storage backends and most of the codebase. A lot of it merely uses asyncio APIs, but still doesn't actually run several things concurrently internally. Further improvements will be added on top of these changes Thanks to Thomas Grainger (@graingert) for a few useful pointers related to asyncio.
20 lines
554 B
Python
20 lines
554 B
Python
import pytest
|
|
|
|
from . import StorageTests
|
|
from vdirsyncer.storage.singlefile import SingleFileStorage
|
|
|
|
|
|
class TestSingleFileStorage(StorageTests):
|
|
|
|
storage_class = SingleFileStorage
|
|
supports_metadata = False
|
|
|
|
@pytest.fixture
|
|
def get_storage_args(self, tmpdir):
|
|
async def inner(collection="test"):
|
|
rv = {"path": str(tmpdir.join("%s.txt")), "collection": collection}
|
|
if collection is not None:
|
|
rv = await self.storage_class.create_collection(**rv)
|
|
return rv
|
|
|
|
return inner
|