Create collections in tests
This commit is contained in:
parent
21461ddb4e
commit
d7f41203f5
@ -44,6 +44,7 @@ class BaseRequests:
|
|||||||
assert status == 200
|
assert status == 200
|
||||||
assert "Radicale works!" in answer
|
assert "Radicale works!" in answer
|
||||||
# Test the creation of the collection
|
# Test the creation of the collection
|
||||||
|
self.request("MKCOL", "/calendar.ics/")
|
||||||
self.request(
|
self.request(
|
||||||
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
||||||
status, headers, answer = self.request("GET", "/calendar.ics/")
|
status, headers, answer = self.request("GET", "/calendar.ics/")
|
||||||
@ -52,6 +53,7 @@ class BaseRequests:
|
|||||||
|
|
||||||
def test_add_event(self):
|
def test_add_event(self):
|
||||||
"""Add an event."""
|
"""Add an event."""
|
||||||
|
self.request("MKCOL", "/calendar.ics/")
|
||||||
self.request(
|
self.request(
|
||||||
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
||||||
event = get_file_content("event1.ics")
|
event = get_file_content("event1.ics")
|
||||||
@ -67,6 +69,7 @@ class BaseRequests:
|
|||||||
|
|
||||||
def test_add_todo(self):
|
def test_add_todo(self):
|
||||||
"""Add a todo."""
|
"""Add a todo."""
|
||||||
|
self.request("MKCOL", "/calendar.ics/")
|
||||||
self.request(
|
self.request(
|
||||||
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
||||||
todo = get_file_content("todo1.ics")
|
todo = get_file_content("todo1.ics")
|
||||||
@ -81,6 +84,7 @@ class BaseRequests:
|
|||||||
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
"""Delete an event."""
|
"""Delete an event."""
|
||||||
|
self.request("MKCOL", "/calendar.ics/")
|
||||||
self.request(
|
self.request(
|
||||||
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
||||||
event = get_file_content("event1.ics")
|
event = get_file_content("event1.ics")
|
||||||
@ -96,6 +100,7 @@ class BaseRequests:
|
|||||||
def _test_filter(self, filters, kind="event", items=1):
|
def _test_filter(self, filters, kind="event", items=1):
|
||||||
filters_text = "".join(
|
filters_text = "".join(
|
||||||
"<C:filter>%s</C:filter>" % filter_ for filter_ in filters)
|
"<C:filter>%s</C:filter>" % filter_ for filter_ in filters)
|
||||||
|
self.request("MKCOL", "/calendar.ics/")
|
||||||
self.request(
|
self.request(
|
||||||
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
"PUT", "/calendar.ics/", "BEGIN:VCALENDAR\r\nEND:VCALENDAR")
|
||||||
for i in range(items):
|
for i in range(items):
|
||||||
|
Loading…
Reference in New Issue
Block a user