MCPcopy
hub / github.com/pimutils/vdirsyncer / test_split_collection_timezones

Function test_split_collection_timezones

tests/unit/utils/test_vobject.py:99–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97
98
99def test_split_collection_timezones():
100 items = [
101 BARE_EVENT_TEMPLATE.format(r=123, uid=123),
102 BARE_EVENT_TEMPLATE.format(r=345, uid=345)
103 ]
104
105 timezone = (
106 'BEGIN:VTIMEZONE\r\n'
107 'TZID:/mozilla.org/20070129_1/Asia/Tokyo\r\n'
108 'X-LIC-LOCATION:Asia/Tokyo\r\n'
109 'BEGIN:STANDARD\r\n'
110 'TZOFFSETFROM:+0900\r\n'
111 'TZOFFSETTO:+0900\r\n'
112 'TZNAME:JST\r\n'
113 'DTSTART:19700101T000000\r\n'
114 'END:STANDARD\r\n'
115 'END:VTIMEZONE'
116 )
117
118 full = '\r\n'.join(
119 ['BEGIN:VCALENDAR']
120 + items
121 + [timezone, 'END:VCALENDAR']
122 )
123
124 given = {normalize_item(item)
125 for item in vobject.split_collection(full)}
126 expected = {
127 normalize_item('\r\n'.join((
128 'BEGIN:VCALENDAR', item, timezone, 'END:VCALENDAR'
129 )))
130 for item in items
131 }
132
133 assert given == expected
134
135
136def test_split_contacts():

Callers

nothing calls this directly

Calls 2

normalize_itemFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected