@@ -312,20 +312,29 @@ async def test_specialchars(
312312 if self .storage_class .storage_name .endswith ("dav" ):
313313 assert urlquote (uid , "/@:" ) in href
314314
315+ @pytest .mark .asyncio
316+ async def test_empty_metadata (self , requires_metadata , s ):
317+ if getattr (self , "dav_server" , "" ):
318+ pytest .skip ()
319+
320+ assert await s .get_meta ("color" ) is None
321+ assert await s .get_meta ("displayname" ) is None
322+
315323 @pytest .mark .asyncio
316324 async def test_metadata (self , requires_metadata , s ):
317- if not getattr (self , "dav_server" , "" ):
318- assert not await s .get_meta ("color" )
319- assert not await s .get_meta ("displayname" )
325+ if getattr (self , "dav_server" , "" ) == "xandikos" :
326+ pytest .skip ("xandikos does not support removing metadata." )
320327
321328 try :
322329 await s .set_meta ("color" , None )
323- assert not await s .get_meta ("color" )
330+ assert await s .get_meta ("color" ) is None
324331 await s .set_meta ("color" , "#ff0000" )
325332 assert await s .get_meta ("color" ) == "#ff0000"
326333 except exceptions .UnsupportedMetadataError :
327334 pass
328335
336+ @pytest .mark .asyncio
337+ async def test_encoding_metadata (self , requires_metadata , s ):
329338 for x in ("hello world" , "hello wörld" ):
330339 await s .set_meta ("displayname" , x )
331340 rv = await s .get_meta ("displayname" )
0 commit comments