()
| 97 | |
| 98 | |
| 99 | def 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 | |
| 136 | def test_split_contacts(): |
nothing calls this directly
no test coverage detected