Skip to content

Commit

Permalink
Test written files are valid calendars
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOrangeOne committed May 1, 2024
1 parent 4866336 commit 5780782
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import sys
from pathlib import Path

import icalendar

from calmerge.config import Config


Expand All @@ -20,4 +22,8 @@ def test_write_config(tmp_path: Path, config: Config, config_path: Path) -> None
assert len(list(tmp_path.glob("*.ics"))) == len(config.calendars)

for calendar_config in config.calendars:
assert tmp_path.joinpath(f"{calendar_config.slug}.ics").is_file()
calendar_path = tmp_path.joinpath(f"{calendar_config.slug}.ics")
assert calendar_path.is_file()

calendar = icalendar.Calendar.from_ical(calendar_path.read_text())
assert not calendar.is_broken

0 comments on commit 5780782

Please sign in to comment.