Skip to content

Commit 90ba986

Browse files
authored
Merge pull request #9 from rkdarst/fix-tests
Fix several tests
2 parents ea66cd8 + 0981352 commit 90ba986

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

tests/test_calendar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ def test_calendar_default_timezone():
4545
- summary: February 1
4646
begin: 2022-02-01 00:00:00 +02:00
4747
duration: {hours: 1}
48+
49+
- summary: Earth day (all day)
50+
begin: 2022-04-22
4851
'''
4952
))]
5053
)

tests/test_events.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def test_rrule():
6060
)
6161
)
6262
event_str = event.serialize()
63-
assert 'DTEND' not in event_str
63+
# DTEND exists and is the next day, calendar tools import this
64+
# correctly as being a one-day event
6465
assert 'RRULE:FREQ=YEARLY;UNTIL=20300422T000000' in event_str
6566

6667

yaml2ics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def event_from_yaml(event_yaml: dict, tz: tzinfo=None) -> ics.Event:
7575
))
7676

7777
event.dtstamp = datetime.utcnow().replace(tzinfo=dateutil.tz.UTC)
78-
if tz and event.floating:
78+
if tz and event.floating and not event.all_day:
7979
event.replace_timezone(tz)
8080
return event
8181

0 commit comments

Comments
 (0)