Test PROPFIND

Regression test for cfa8c7d8b4
This commit is contained in:
Unrud 2016-08-07 17:51:16 +02:00
parent cfa8c7d8b4
commit ce0a2fd01d

View File

@ -20,6 +20,7 @@ Radicale tests with simple requests.
""" """
import logging import logging
import posixpath
import shutil import shutil
import tempfile import tempfile
@ -188,6 +189,21 @@ class BaseRequests:
status, headers, answer = self.request("GET", "/event1.ics") status, headers, answer = self.request("GET", "/event1.ics")
assert status == 404 assert status == 404
def test_propfind(self):
calendar_path = "/calendar.ics/"
self.request("MKCALENDAR", calendar_path)
event = get_file_content("event1.ics")
event_path = posixpath.join(calendar_path, "event.ics")
self.request("PUT", event_path, event)
status, headers, answer = self.request("PROPFIND", "/", HTTP_DEPTH="1")
assert status == 207
assert "href>/</" in answer
assert "href>%s</" % calendar_path in answer
status, headers, answer = self.request("PROPFIND", calendar_path, HTTP_DEPTH="1")
assert status == 207
assert "href>%s</" % calendar_path in answer
assert "href>%s</" % event_path in answer
def test_multiple_events_with_same_uid(self): def test_multiple_events_with_same_uid(self):
"""Add two events with the same UID.""" """Add two events with the same UID."""
self.request("MKCOL", "/calendar.ics/") self.request("MKCOL", "/calendar.ics/")