add new test cases for broken items

This commit is contained in:
Peter Bieringer
2025-12-01 18:50:46 +01:00
parent 6c496b8021
commit 5b2cb5c0bf
5 changed files with 116 additions and 0 deletions

View File

@@ -142,6 +142,20 @@ permissions: RrWw""")
assert "Event" in answer
assert "UID:event" in answer
def test_add_event_broken(self) -> None:
"""Add a broken event."""
self.mkcalendar("/calendar.ics/")
event = get_file_content("broken-vevent.ics")
path = "/calendar.ics/broken-vevent.ics"
self.put(path, event, check=400)
def test_add_events_broken2(self) -> None:
"""Add a broken event (2nd one is broken)."""
self.mkcalendar("/calendar.ics/")
event = get_file_content("broken-vevents.ics")
path = "/calendar.ics/"
self.put(path, event, check=400)
def test_add_event_without_uid(self) -> None:
"""Add an event without UID."""
self.mkcalendar("/calendar.ics/")
@@ -201,6 +215,34 @@ permissions: RrWw""")
_, answer = self.get(path)
assert "UID:contact1" in answer
def test_add_contact_broken(self) -> None:
"""Add a broken contact."""
self.create_addressbook("/contacts.vcf/")
contact = get_file_content("broken-vcard.vcf")
path = "/contacts.vcf/broken-vcards.vcf"
self.put(path, contact, check=400)
def test_add_contacts_broken(self) -> None:
"""Add broken contacts."""
self.create_addressbook("/contacts.vcf/")
contact = get_file_content("broken-vcards.vcf")
path = "/contacts.vcf/"
self.put(path, contact, check=400)
def test_add_contacts_broken2(self) -> None:
"""Add broken contacts (only 2nd one is broken)."""
self.create_addressbook("/contacts.vcf/")
contact = get_file_content("broken-vcards2.vcf")
path = "/contacts.vcf/"
self.put(path, contact, check=400)
def test_add_contacts_broken2_no_uid(self) -> None:
"""Add broken contacts (only 2nd one is broken and has no UID)."""
self.create_addressbook("/contacts.vcf/")
contact = get_file_content("broken-vcards2-no_uid.vcf")
path = "/contacts.vcf/"
self.put(path, contact, check=400)
def test_add_contact_photo_with_data_uri(self) -> None:
"""Test workaround for broken PHOTO data from InfCloud"""
self.create_addressbook("/contacts.vcf/")