def test_new_event(self, coll_vdirs): coll, vdirs = coll_vdirs event = coll.new_event(event_today, aux.cal1) coll.new(event) assert [' a meeting :: short description\x1b[0m'] == \ get_list_from_str(coll, aux.locale, [], format=event_format, default_timedelta='1d', day_format="")
def test_new_event_day_format(self, coll_vdirs): coll, vdirs = coll_vdirs event = coll.new_event(event_today, utils.cal1) coll.new(event) start, end = start_end_from_daterange([], utils.locale) assert ['Today\x1b[0m', ' a meeting :: short description\x1b[0m'] == \ get_list_from_str(coll, utils.locale, start, end, format=event_format, default_timedelta='1d', day_format="{name}")
def test_empty_recurrence(self, coll_vdirs): coll, vidrs = coll_vdirs coll.new(coll.new_event(dedent( 'BEGIN:VEVENT\r\n' 'UID:no_recurrences\r\n' 'SUMMARY:No recurrences\r\n' 'RRULE:FREQ=DAILY;COUNT=2;INTERVAL=1\r\n' 'EXDATE:20110908T130000\r\n' 'EXDATE:20110909T130000\r\n' 'DTSTART:20110908T130000\r\n' 'DTEND:20110908T170000\r\n' 'END:VEVENT\r\n' ), aux.cal1)) assert 'no events' in '\n'.join(get_list_from_str(coll, aux.locale, [], format=event_format, default_timedelta='1d')).lower()
def test_empty_recurrence(self, coll_vdirs): coll, vidrs = coll_vdirs coll.new(coll.new_event(dedent( 'BEGIN:VEVENT\r\n' 'UID:no_recurrences\r\n' 'SUMMARY:No recurrences\r\n' 'RRULE:FREQ=DAILY;COUNT=2;INTERVAL=1\r\n' 'EXDATE:20110908T130000\r\n' 'EXDATE:20110909T130000\r\n' 'DTSTART:20110908T130000\r\n' 'DTEND:20110908T170000\r\n' 'END:VEVENT\r\n' ), utils.cal1)) start, end = start_end_from_daterange([], utils.locale) assert 'no events' in '\n'.join( get_list_from_str( coll, utils.locale, start, end, format=event_format, default_timedelta='1d') ).lower()