Repair calendar and address book imports
Debian Trixie package bundle / packages (push) Successful in 21m37s
Debian Trixie package bundle / packages (push) Successful in 21m37s
This commit is contained in:
@@ -30,6 +30,9 @@ from bongo import table
|
||||
from bongo.Console import wrap
|
||||
from bongo.external.simpletal import simpleTAL, simpleTALES
|
||||
from bongo.store.StoreClient import CalendarACL, StoreClient
|
||||
from bongo.storetool.CalendarCommands import (_collection_name,
|
||||
_event_filename,
|
||||
_event_payload)
|
||||
from bongo.storetool.Connection import connect_store
|
||||
from bongo.storetool.ExportMailbox import MaildirMailbox, MboxMailbox
|
||||
|
||||
@@ -68,6 +71,24 @@ class Python3RuntimeTests(unittest.TestCase):
|
||||
"alice", "alice-store", host="store.example.test", port=1689,
|
||||
authPassword="secret")
|
||||
|
||||
def test_calendar_import_splits_events_and_normalizes_collection_names(self):
|
||||
import vobject
|
||||
|
||||
source = vobject.readOne(
|
||||
"BEGIN:VCALENDAR\r\n"
|
||||
"VERSION:2.0\r\n"
|
||||
"BEGIN:VEVENT\r\n"
|
||||
"UID:event@example.test\r\n"
|
||||
"DTSTART:20260724T080000Z\r\n"
|
||||
"END:VEVENT\r\n"
|
||||
"END:VCALENDAR\r\n")
|
||||
event = source.vevent
|
||||
payload = _event_payload(source, event)
|
||||
self.assertEqual(_collection_name("/calendars/personal"), "personal")
|
||||
self.assertIn("BEGIN:VEVENT", payload)
|
||||
self.assertIn("UID:event@example.test", payload)
|
||||
self.assertRegex(_event_filename(event), r"^import-[0-9a-f]{64}$")
|
||||
|
||||
def test_console_table_and_unicode_template_are_text(self):
|
||||
self.assertIsInstance(wrap("Grüße 世界", width=8), str)
|
||||
self.assertEqual(table.format_table(["Name"], [["Müller"]]),
|
||||
|
||||
Reference in New Issue
Block a user