Skip test on unsupported servers

This commit is contained in:
Hugo Osvaldo Barrera 2021-07-23 19:27:48 +02:00
parent c0ccb3d1aa
commit 7379a96f73

View file

@ -312,11 +312,18 @@ class StorageTests:
assert urlquote(uid, "/@:") in href assert urlquote(uid, "/@:") in href
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_metadata(self, requires_metadata, s): async def test_empty_metadata(self, requires_metadata, s):
if not getattr(self, "dav_server", ""): if getattr(self, "dav_server", ""):
pytest.skip()
assert await s.get_meta("color") is None assert await s.get_meta("color") is None
assert await s.get_meta("displayname") is None assert await s.get_meta("displayname") is None
@pytest.mark.asyncio
async def test_metadata(self, requires_metadata, s):
if getattr(self, "dav_server", "") == "xandikos":
pytest.skip("xandikos does not support removing metadata.")
try: try:
await s.set_meta("color", None) await s.set_meta("color", None)
assert await s.get_meta("color") is None assert await s.get_meta("color") is None
@ -325,6 +332,8 @@ class StorageTests:
except exceptions.UnsupportedMetadataError: except exceptions.UnsupportedMetadataError:
pass pass
@pytest.mark.asyncio
async def test_encoding_metadata(self, requires_metadata, s):
for x in ("hello world", "hello wörld"): for x in ("hello world", "hello wörld"):
await s.set_meta("displayname", x) await s.set_meta("displayname", x)
rv = await s.get_meta("displayname") rv = await s.get_meta("displayname")