diff options
Diffstat (limited to 'desktop/island/calendar/test_calctl.py')
| -rw-r--r-- | desktop/island/calendar/test_calctl.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/desktop/island/calendar/test_calctl.py b/desktop/island/calendar/test_calctl.py index 91ad384..e6b3da2 100644 --- a/desktop/island/calendar/test_calctl.py +++ b/desktop/island/calendar/test_calctl.py @@ -290,5 +290,30 @@ assert "json" in run("new", "{not json", ok=False) assert sorted(p.name for p in tmp.rglob("*.ics")) == before no_temp() +# read: an outside .ics as a new draft in the default calendar, nothing written. +put(tmp / "invite.ics", """ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//test//EN +BEGIN:VEVENT +UID:invite-1 +DTSTAMP:20260101T000000Z +DTSTART:20261203T140000Z +DTEND:20261203T153000Z +SUMMARY:Dentist +LOCATION:Main St 1 +RRULE:FREQ=WEEKLY;BYDAY=TH +END:VEVENT +END:VCALENDAR +""") +before = sorted(p.name for p in tmp.rglob("*.ics")) +r = run("read", str(tmp / "invite.ics")) +assert (r["uid"], r["calendar"], r["title"], r["location"]) == ("", "home", "Dentist", "Main St 1"), r +assert (r["start"], r["end"], r["allDay"], r["repeat"]) == ("2026-12-03T15:00", "2026-12-03T16:30", False, "none"), r +assert sorted(p.name for p in tmp.rglob("*.ics")) == before +put(tmp / "bad.ics", "hello") +assert "not a calendar" in run("read", str(tmp / "bad.ics"), ok=False) +assert "cannot read" in run("read", str(tmp / "missing.ics"), ok=False) + shutil.rmtree(tmp) print("test_calctl: ok") |
