Test PROPFIND
Regression test for cfa8c7d8b4b0dd9f92a974b36dd92222e25bf8a9
This commit is contained in:
parent
cfa8c7d8b4
commit
ce0a2fd01d
@ -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/")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user