mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Execute one assertion per line
This commit is contained in:
parent
a4d4bf8fd1
commit
1502f5b5f4
4 changed files with 14 additions and 7 deletions
|
|
@ -48,7 +48,8 @@ class TestFilesystemStorage(StorageTests):
|
||||||
s = self.storage_class(str(tmpdir), ".txt")
|
s = self.storage_class(str(tmpdir), ".txt")
|
||||||
await s.upload(Item("UID:a/b/c"))
|
await s.upload(Item("UID:a/b/c"))
|
||||||
(item_file,) = tmpdir.listdir()
|
(item_file,) = tmpdir.listdir()
|
||||||
assert "/" not in item_file.basename and item_file.isfile()
|
assert "/" not in item_file.basename
|
||||||
|
assert item_file.isfile()
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_ignore_tmp_files(self, tmpdir):
|
async def test_ignore_tmp_files(self, tmpdir):
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,8 @@ async def test_read_only_and_prefetch():
|
||||||
await sync(a, b, status, force_delete=True)
|
await sync(a, b, status, force_delete=True)
|
||||||
await sync(a, b, status, force_delete=True)
|
await sync(a, b, status, force_delete=True)
|
||||||
|
|
||||||
assert not items(a) and not items(b)
|
assert not items(a)
|
||||||
|
assert not items(b)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
@ -226,7 +227,8 @@ async def test_insert_hash():
|
||||||
|
|
||||||
await a.update(href, Item("UID:1\nHAHA:YES"), etag)
|
await a.update(href, Item("UID:1\nHAHA:YES"), etag)
|
||||||
await sync(a, b, status)
|
await sync(a, b, status)
|
||||||
assert "hash" in status["1"][0] and "hash" in status["1"][1]
|
assert "hash" in status["1"][0]
|
||||||
|
assert "hash" in status["1"][1]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
@ -665,7 +667,8 @@ class SyncMachine(RuleBasedStateMachine):
|
||||||
except ActionIntentionallyFailed:
|
except ActionIntentionallyFailed:
|
||||||
pass
|
pass
|
||||||
except BothReadOnly:
|
except BothReadOnly:
|
||||||
assert a.read_only and b.read_only
|
assert a.read_only
|
||||||
|
assert b.read_only
|
||||||
assume(False)
|
assume(False)
|
||||||
except StorageEmpty:
|
except StorageEmpty:
|
||||||
if force_delete:
|
if force_delete:
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ async def test_basic(monkeypatch):
|
||||||
|
|
||||||
await a.set_meta("foo", None)
|
await a.set_meta("foo", None)
|
||||||
await metasync(a, b, status, keys=["foo"])
|
await metasync(a, b, status, keys=["foo"])
|
||||||
assert await a.get_meta("foo") is None and await b.get_meta("foo") is None
|
assert await a.get_meta("foo") is None
|
||||||
|
assert await b.get_meta("foo") is None
|
||||||
|
|
||||||
await a.set_meta("foo", "bar")
|
await a.set_meta("foo", "bar")
|
||||||
await metasync(a, b, status, keys=["foo"])
|
await metasync(a, b, status, keys=["foo"])
|
||||||
|
|
@ -54,7 +55,8 @@ async def test_basic(monkeypatch):
|
||||||
|
|
||||||
await b.set_meta("foo", None)
|
await b.set_meta("foo", None)
|
||||||
await metasync(a, b, status, keys=["foo"])
|
await metasync(a, b, status, keys=["foo"])
|
||||||
assert not await a.get_meta("foo") and not await b.get_meta("foo")
|
assert not await a.get_meta("foo")
|
||||||
|
assert not await b.get_meta("foo")
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,8 @@ class VobjectMachine(RuleBasedStateMachine):
|
||||||
assert key in c
|
assert key in c
|
||||||
assert c.get(key) == value
|
assert c.get(key) == value
|
||||||
dump = "\r\n".join(c.dump_lines())
|
dump = "\r\n".join(c.dump_lines())
|
||||||
assert key in dump and value in dump
|
assert key in dump
|
||||||
|
assert value in dump
|
||||||
|
|
||||||
@rule(
|
@rule(
|
||||||
c=Parsed,
|
c=Parsed,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue