File tree 2 files changed +35
-44
lines changed
2 files changed +35
-44
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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 \n X-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 \n END:VEVENT\r \n '
32
+ )
33
+
34
+ # roundtrip
35
+ assert event .to_ical () == icalendar .Event .from_ical (event .to_ical ()).to_ical ()
You can’t perform that action at this time.
0 commit comments