Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add journal timeline feature and test coverage #434

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/test_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from ical.exceptions import CalendarParseError
from ical.journal import Journal, JournalStatus
from ical.timespan import Timespan


def test_empty() -> None:
Expand Down Expand Up @@ -43,3 +44,9 @@ def test_start_datetime() -> None:
"ical.util.local_timezone", return_value=zoneinfo.ZoneInfo("America/Regina")
):
assert journal.start_datetime.isoformat() == "2022-08-07T06:00:00+00:00"

assert not journal.recurring
ts = journal.timespan
assert ts
assert ts.start == datetime.datetime(2022, 8, 7, 0, 0, 0, tzinfo=datetime.timezone.utc)
assert ts.end == datetime.datetime(2022, 8, 8, 0, 0, 0, tzinfo=datetime.timezone.utc)
1 change: 1 addition & 0 deletions tests/test_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_journal_timeline() -> None:
start=datetime.date(2022, 8, 7),
rrule=Recur.from_rrule("FREQ=DAILY;COUNT=3"),
)
assert journal.recurring

timeline = generic_timeline([journal], TZ)
assert list(timeline) == [
Expand Down