mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Fix bug
This commit is contained in:
parent
13ecb42e60
commit
e25e4dc0cb
2 changed files with 43 additions and 1 deletions
|
|
@ -93,3 +93,45 @@ def test_multiline_uid():
|
|||
u' efgh\r\n'
|
||||
u'END:FOO\r\n')
|
||||
assert vobject.Item(a).uid == u'123456789abcdefgh'
|
||||
|
||||
def test_multiline_uid_complex():
|
||||
a = u'''
|
||||
BEGIN:VCALENDAR
|
||||
BEGIN:VTIMEZONE
|
||||
TZID:Europe/Rome
|
||||
X-LIC-LOCATION:Europe/Rome
|
||||
BEGIN:DAYLIGHT
|
||||
TZOFFSETFROM:+0100
|
||||
TZOFFSETTO:+0200
|
||||
TZNAME:CEST
|
||||
DTSTART:19700329T020000
|
||||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
|
||||
END:DAYLIGHT
|
||||
BEGIN:STANDARD
|
||||
TZOFFSETFROM:+0200
|
||||
TZOFFSETTO:+0100
|
||||
TZNAME:CET
|
||||
DTSTART:19701025T030000
|
||||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
|
||||
END:STANDARD
|
||||
END:VTIMEZONE
|
||||
BEGIN:VEVENT
|
||||
DTSTART:20140124T133000Z
|
||||
DTEND:20140124T143000Z
|
||||
DTSTAMP:20140612T090652Z
|
||||
UID:040000008200E00074C5B7101A82E0080000000050AAABEEF50DCF0100000000000000
|
||||
001000000062548482FA830A46B9EA62114AC9F0EF
|
||||
CREATED:20140110T102231Z
|
||||
DESCRIPTION:Test.
|
||||
LAST-MODIFIED:20140123T095221Z
|
||||
LOCATION:25.12.01.51
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
SUMMARY:Präsentation
|
||||
TRANSP:OPAQUE
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
'''.strip()
|
||||
assert vobject.Item(a).uid == (u'040000008200E00074C5B7101A82E008000000005'
|
||||
u'0AAABEEF50DCF0100000000000000001000000062'
|
||||
u'548482FA830A46B9EA62114AC9F0EF')
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class Item(object):
|
|||
stack = [self.parsed]
|
||||
while stack:
|
||||
component = stack.pop()
|
||||
if not component:
|
||||
if component is None:
|
||||
continue
|
||||
uid = component.get('UID', None)
|
||||
if uid:
|
||||
|
|
|
|||
Loading…
Reference in a new issue