Skip to content

Commit 1df99af

Browse files
committed
ics 0.8.0: name → summary
1 parent b934953 commit 1df99af

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

tests/test_events.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ def test_basic_structure():
77
event = event_ics_from_yaml(
88
parse_yaml(
99
'''
10-
name: Earth Day
10+
summary: Earth Day
1111
begin: 2021-04-22
1212
url: https://earthday.org
13+
location: Earth
1314
'''
1415
)
1516
)
@@ -19,7 +20,9 @@ def test_basic_structure():
1920
lines = event_str.split('\n')
2021
for line in lines[:-1]:
2122
assert line.endswith('\r')
22-
23+
assert 'SUMMARY:Earth Day' in event_str
24+
assert 'URL:https://earthday.org' in event_str
25+
assert 'LOCATION:Earth' in event_str
2326
# All events must have a DTSTAMP
2427
assert 'DTSTAMP' in event_str
2528

@@ -28,7 +31,7 @@ def test_all_day_event():
2831
event = event_ics_from_yaml(
2932
parse_yaml(
3033
'''
31-
name: Earth Day
34+
summary: Earth Day
3235
begin: 2021-04-22
3336
url: https://earthday.org
3437
'''
@@ -46,7 +49,7 @@ def test_rrule():
4649
event = event_ics_from_yaml(
4750
parse_yaml(
4851
'''
49-
name: Earth Day
52+
summary: Earth Day
5053
begin: 2021-04-22
5154
url: https://earthday.org
5255
repeat:
@@ -65,7 +68,7 @@ def test_event_with_time_range():
6568
event = event_ics_from_yaml(
6669
parse_yaml(
6770
'''
68-
name: Event of the Century
71+
summary: Event of the Century
6972
begin: 2021-09-21 15:00:00 -07:00
7073
end: 2021-09-21 15:30:00 -07:00
7174
description: |
@@ -82,7 +85,7 @@ def test_event_with_duration():
8285
event = event_ics_from_yaml(
8386
parse_yaml(
8487
'''
85-
name: Event of the Century
88+
summary: Event of the Century
8689
begin: 2021-09-21 15:00:00 -07:00
8790
duration:
8891
minutes: 30

yaml2ics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
def event_ics_from_yaml(event_yaml: dict) -> ics.Event:
2323
d = event_yaml
2424
repeat = d.pop('repeat', None)
25-
if 'name' in d:
26-
d['summary'] = d.pop('name')
2725

2826
# Strip all string values, since they often end on `\n`
2927
for key in d:

0 commit comments

Comments
 (0)