Skip to content

Commit 0650cc3

Browse files
author
Hugo Osvaldo Barrera
committed
Add test for #918
We're doing something wrong with UID/href quoting/unquoting, but I've yet to figure out what.
1 parent 6281e7a commit 0650cc3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/storage/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,26 @@ async def test_specialchars(
310310
if self.storage_class.storage_name.endswith("dav"):
311311
assert urlquote(uid, "/@:") in href
312312

313+
@pytest.mark.asyncio
314+
async def test_newline_in_uid(
315+
self, monkeypatch, requires_collections, get_storage_args, get_item
316+
):
317+
monkeypatch.setattr("vdirsyncer.utils.generate_href", lambda x: x)
318+
319+
uid = "20210609T084907Z-@synaps-web-54fddfdf7-7kcfm%0A.ics"
320+
321+
s = self.storage_class(**await get_storage_args())
322+
item = get_item(uid=uid)
323+
324+
href, etag = await s.upload(item)
325+
item2, etag2 = await s.get(href)
326+
if etag is not None:
327+
assert etag2 == etag
328+
assert_item_equals(item2, item)
329+
330+
((_, etag3),) = await aiostream.stream.list(s.list())
331+
assert etag2 == etag3
332+
313333
@pytest.mark.asyncio
314334
async def test_empty_metadata(self, requires_metadata, s):
315335
if getattr(self, "dav_server", ""):

0 commit comments

Comments
 (0)