Skip to content

Commit 00a2d56

Browse files
authored
Merge pull request #597 from niccokunzmann/refactor-test-1
refactor test file for issue 116
2 parents 7db6b37 + 9f5d7ba commit 00a2d56

File tree

2 files changed

+35
-44
lines changed

2 files changed

+35
-44
lines changed

src/icalendar/tests/test_fixed_issues.py

-44
This file was deleted.

src/icalendar/tests/test_issue_116.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import unittest
2+
3+
import datetime
4+
import icalendar
5+
import os
6+
import pytz
7+
import pytest
8+
from dateutil import tz
9+
10+
11+
def test_issue_116():
12+
"""Issue #116/#117 - How to add 'X-APPLE-STRUCTURED-LOCATION'
13+
https://github.com/collective/icalendar/issues/116
14+
https://github.com/collective/icalendar/issues/117
15+
"""
16+
event = icalendar.Event()
17+
event.add(
18+
"X-APPLE-STRUCTURED-LOCATION",
19+
"geo:-33.868900,151.207000",
20+
parameters={
21+
"VALUE": "URI",
22+
"X-ADDRESS": "367 George Street Sydney CBD NSW 2000",
23+
"X-APPLE-RADIUS": "72",
24+
"X-TITLE": "367 George Street"
25+
}
26+
)
27+
assert event.to_ical() == (
28+
b'BEGIN:VEVENT\r\nX-APPLE-STRUCTURED-LOCATION;VALUE=URI;'
29+
b'X-ADDRESS="367 George Street Sydney \r\n CBD NSW 2000";'
30+
b'X-APPLE-RADIUS=72;X-TITLE="367 George Street":'
31+
b'geo:-33.868900\r\n \\,151.207000\r\nEND:VEVENT\r\n'
32+
)
33+
34+
# roundtrip
35+
assert event.to_ical() == icalendar.Event.from_ical(event.to_ical()).to_ical()

0 commit comments

Comments
 (0)