コード例 #1
0
 def headers(self):
     headers = (self.session.query(DBHeader).filter_by(
         collection_path=self.path).order_by(DBHeader.name).all())
     return [
         ical.Header("%s:%s" % (header.name, header.value))
         for header in headers
     ]
コード例 #2
0
ファイル: storage.py プロジェクト: mediafactory/yats
 def headers(self):
     return (
         ical.Header('PRODID:-//YATS//NONSGML Radicale Server//EN'),
         ical.Header('VERSION:%s' % self.version))
コード例 #3
0
 def headers(self):
     return (
         # ToDo: Probably change this information to workbench related version
         ical.Header('PRODID:-//Radicale//NONSGML Radicale Server//EN'),
         ical.Header('VERSION:%s' % self.version))
コード例 #4
0
class SerializationTestCase(TestCase):
    DATA_CASES = (('''BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Ximian//NONSGML Evolution Calendar//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:/freeassociation.sourceforge.net/Europe/Moscow
X-LIC-LOCATION:Europe/Moscow
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19300621T000000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19810401T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19811001T000000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19820401T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19821001T000000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19830401T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19831001T000000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19840401T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19840930T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19850331T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19850929T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19860330T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19860928T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19870329T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19870927T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19880327T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19880925T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19890326T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19890924T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19900325T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19900930T030000
TZOFFSETFROM:+0300
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:EEST
DTSTART:19910331T020000
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:EET
DTSTART:19910929T030000
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
END:STANDARD
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19920119T020000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19920329T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19920927T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19930328T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19930926T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19940327T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19940925T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19950326T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19950924T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19960331T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19961027T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19970330T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19971026T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19980329T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19981025T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19990328T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19991031T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20000326T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20001029T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20010325T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20011028T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20020331T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20021027T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20030330T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20031026T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20040328T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20041031T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20050327T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20051030T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20060326T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20061029T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20070325T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20071028T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20080330T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20081026T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20090329T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20091025T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20100328T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20101031T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20110327T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
END:STANDARD
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20141026T020000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:20160729T101032Z-9313-1000-4291-10@localhost
DTSTAMP:20160729T063824Z
DTSTART;TZID=/freeassociation.sourceforge.net/Europe/Moscow:
 20160721T090000
DTEND;TZID=/freeassociation.sourceforge.net/Europe/Moscow:
 20160721T093000
SEQUENCE:2
SUMMARY:zzzzz
CLASS:PUBLIC
TRANSP:OPAQUE
CREATED:20160729T101116Z
LAST-MODIFIED:20160729T101116Z
END:VEVENT
END:VCALENDAR''', '''BEGIN:VCALENDAR
PRODID:-//Radicale//NONSGML Radicale Server//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:/freeassociation.sourceforge.net/Europe/Moscow
X-LIC-LOCATION:Europe/Moscow
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19300621T000000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19810401T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19811001T000000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19820401T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19821001T000000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19830401T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19831001T000000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19840401T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19840930T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19850331T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19850929T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19860330T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19860928T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19870329T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19870927T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19880327T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19880925T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19890326T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19890924T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19900325T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19900930T030000
TZOFFSETFROM:+0300
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:EEST
DTSTART:19910331T020000
TZOFFSETFROM:+0200
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:EET
DTSTART:19910929T030000
TZOFFSETFROM:+0300
TZOFFSETTO:+0200
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19920119T020000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19920329T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19920927T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19930328T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19930926T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19940327T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19940925T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19950326T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19950924T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19960331T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19961027T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19970330T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19971026T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19980329T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19981025T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:19990328T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:19991031T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20000326T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20001029T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20010325T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20011028T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20020331T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20021027T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20030330T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20031026T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20040328T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20041031T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20050327T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20051030T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20060326T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20061029T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20070325T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20071028T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20080330T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20081026T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20090329T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20091025T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:MSD
DTSTART:20100328T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20101031T030000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20110327T020000
TZOFFSETFROM:+0300
TZOFFSETTO:+0400
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
BEGIN:STANDARD
TZNAME:MSK
DTSTART:20141026T020000
TZOFFSETFROM:+0400
TZOFFSETTO:+0300
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:STANDARD
X-RADICALE-NAME:/freeassociation.sourceforge.net/Europe/Moscow
END:VTIMEZONE
BEGIN:VEVENT
UID:20160729T101032Z-9313-1000-4291-10@localhost
DTSTAMP:20160729T063824Z
DTSTART;TZID=/freeassociation.sourceforge.net/Europe/Moscow:
 20160721T090000
DTEND;TZID=/freeassociation.sourceforge.net/Europe/Moscow:
 20160721T093000
SEQUENCE:2
SUMMARY:zzzzz
CLASS:PUBLIC
TRANSP:OPAQUE
CREATED:20160729T101116Z
LAST-MODIFIED:20160729T101116Z
X-RADICALE-NAME:20160729T101032Z-9313-1000-4291-10_localhost-20160729T101116Z.ics
END:VEVENT
END:VCALENDAR
'''), )

    HEADERS = (ical.Header('PRODID:-//Radicale//NONSGML Radicale Server//EN'),
               ical.Header('VERSION:2.0'))
    TAG = 'VCALENDAR'

    maxDiff = None

    def test_serialization(self):
        name = '20160729T101032Z-9313-1000-4291-10_localhost-20160729T101116Z.ics'

        for input_text, stored_text in self.DATA_CASES:
            items = ical.Collection._parse(input_text, ICAL_TYPES, name)
            self.assertEqual(name in items, True)

            timezones = list(
                filter(lambda x: x.tag == ical.Timezone.tag, items.values()))
            serialized_text = ical.serialize(self.TAG, self.HEADERS,
                                             [items[name]] + timezones)
            self.assertEqual(serialized_text, stored_text)

            items2 = ical.Collection._parse(serialized_text, ICAL_TYPES, name)
            self.assertEqual(name in items2, True)