sharing/map: add test cases for collections without trailing /

This commit is contained in:
Peter Bieringer
2026-08-01 08:47:01 +02:00
parent 9f2d193fa5
commit 4952d2c3d9

View File

@@ -1988,10 +1988,34 @@ class TestSharingApiSanity(BaseTest):
json_dict['PathOrToken'] = path_shared
_, headers, answer = self._sharing_api_json("map", "enable", check=200, login="user:userpw", json_dict=json_dict)
# check GET as user
logging.info("\n*** GET collection user -> ok")
_, headers, answer = self.request("GET", path_shared, check=200, login="user:userpw")
# check REPORT as user
logging.info("\n*** REPORT collection user -> ok")
_, responses = self.report(path_shared, """\
<?xml version="1.0" encoding="utf-8" ?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<D:getetag />
</D:prop>
</C:calendar-query>""", login="user:userpw")
assert len(responses) == 1
logging.info("response: %r", responses)
response = responses[path_shared_item]
assert isinstance(response, dict)
status, prop = response["D:getetag"]
assert status == 200 and prop.text
# check GET as user without trailing /
logging.info("\n*** GET collection user (without trailing /) -> ok")
_, headers, answer = self.request("GET", path_shared.removesuffix("/"), check=200, login="user:userpw")
# check REPORT as user without trailing /
logging.info("\n*** REPORT collection user (without trailing /) -> ok")
_, responses = self.report(path_shared.removesuffix("/"), """\
<?xml version="1.0" encoding="utf-8" ?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<D:getetag />