Skip to content

Commit

Permalink
improve test for issue #27
Browse files Browse the repository at this point in the history
  • Loading branch information
jacadzaca committed Sep 30, 2023
1 parent ccc3810 commit 1b44560
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//davmail.sf.net/NONSGML DavMail Calendar V1.1//EN
METHOD:REPLY
BEGIN:VFREEBUSY
DTSTAMP:20120131T123000Z
ORGANIZER:MAILTO:organizer@domain.tld
DTSTART:20120101T000000Z
DTEND:20120201T000000Z
UID:null
ATTENDEE:MAILTO:attendee@domain.tld
FREEBUSY;FBTYPE=BUSY:20120103T091500Z/20120103T101500Z
FREEBUSY;FBTYPE=BUSY:20120113T130000Z/20120113T150000Z
FREEBUSY;FBTYPE=BUSY:20120116T130000Z/20120116T150000Z
FREEBUSY;FBTYPE=BUSY:20120117T091500Z/20120117T101500Z
FREEBUSY;FBTYPE=BUSY:20120118T160000Z/20120118T163000Z
FREEBUSY;FBTYPE=BUSY:20120124T083000Z/20120124T093000Z
FREEBUSY;FBTYPE=BUSY:20120124T123000Z/20120124T143000Z
FREEBUSY;FBTYPE=BUSY:20120131T091500Z/20120131T101500Z
END:VFREEBUSY
END:VCALENDAR
11 changes: 7 additions & 4 deletions src/icalendar/tests/test_issue_27_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
from icalendar import Calendar

def test_issue_27_multiple_periods(calendars):
free_busy = list(calendars.issue_27_multiple_periods.walk('VFREEBUSY'))
assert len(free_busy) == 1


free_busy = list(calendars.issue_27_multiple_periods_in_freebusy_multiple_freebusies.walk('VFREEBUSY'))[0]
free_busy_period = free_busy['freebusy']
print(free_busy['freebusy'])
equivalent_way_of_defining_free_busy = list(calendars.issue_27_multiple_periods_in_freebusy_one_freebusy.walk('VFREEBUSY'))[0]
free_busy_period_equivalent = equivalent_way_of_defining_free_busy['freebusy']
assert free_busy_period == free_busy_period_equivalent

0 comments on commit 1b44560

Please sign in to comment.