-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show partstat status for calendar's address
- Loading branch information
Showing
11 changed files
with
121 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ def coll_vdirs(tmpdir) -> CollVdirType: | |
color='dark blue', | ||
priority=10, | ||
ctype='calendar', | ||
address='[email protected]', | ||
) | ||
vdirs[name] = Vdir(path, '.ics') | ||
coll = CalendarCollection(calendars=calendars, dbpath=':memory:', locale=LOCALE_BERLIN) | ||
|
@@ -71,7 +72,8 @@ def coll_vdirs_birthday(tmpdir): | |
os.makedirs(path, mode=0o770) | ||
readonly = True if name == 'a_calendar' else False | ||
calendars[name] = {'name': name, 'path': path, 'color': 'dark blue', | ||
'readonly': readonly, 'unicode_symbols': True, 'ctype': 'birthdays'} | ||
'readonly': readonly, 'unicode_symbols': True, 'ctype': 'birthdays', | ||
'address': '[email protected]'} | ||
vdirs[name] = Vdir(path, '.vcf') | ||
coll = CalendarCollection(calendars=calendars, dbpath=':memory:', locale=LOCALE_BERLIN) | ||
coll.default_calendar_name = cal1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -687,3 +687,38 @@ def test_timezone_creation_with_arbitrary_dates(freeze_ts, event_time): | |
assert len(vtimezone) > 14 | ||
assert 'BEGIN:STANDARD' in vtimezone | ||
assert 'BEGIN:DAYLIGHT' in vtimezone | ||
|
||
|
||
def test_partstat(): | ||
FORMAT_CALENDAR = ( | ||
'{calendar-color}{partstat-symbol}{status-symbol}{start-end-time-style} ({calendar}) ' | ||
'{title} [{location}]{repeat-symbol}' | ||
) | ||
|
||
event = Event.fromString( | ||
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS) | ||
assert event.partstat == 'ACCEPTED' | ||
assert human_formatter(FORMAT_CALENDAR)(event.attributes(dt.date(2014, 4, 9))) == \ | ||
'✔09:30-10:30 (foobar) An Event []\x1b[0m' | ||
|
||
event = Event.fromString( | ||
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS) | ||
assert event.partstat == 'DECLINED' | ||
assert human_formatter(FORMAT_CALENDAR)(event.attributes(dt.date(2014, 4, 9))) == \ | ||
'❌09:30-10:30 (foobar) An Event []\x1b[0m' | ||
|
||
event = Event.fromString( | ||
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS) | ||
assert event.partstat == 'ACCEPTED' | ||
assert human_formatter(FORMAT_CALENDAR)(event.attributes(dt.date(2014, 4, 9))) == \ | ||
'✔09:30-10:30 (foobar) An Event []\x1b[0m' | ||
|
||
@pytest.mark.xfail | ||
def test_partstat_deligated(): | ||
event = Event.fromString( | ||
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS) | ||
assert event.partstat == 'ACCEPTED' | ||
|
||
event = Event.fromString( | ||
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS) | ||
assert event.partstat == 'ACCEPTED' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//PIMUTILS.ORG//NONSGML khal / icalendar //EN | ||
BEGIN:VEVENT | ||
SUMMARY:An Event | ||
DTSTART;TZID=Europe/Berlin:20140409T093000 | ||
DTEND;TZID=Europe/Berlin:20140409T103000 | ||
DTSTAMP:20140401T234817Z | ||
UID:V042MJ8B3SJNFXQOJL6P53OFMHJE8Z3VZWOU | ||
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=TENTATIVE;DELEGATED-FROM= | ||
"mailto:[email protected]";CN=Henry Cabot:mailto:hcabot@ | ||
example.com | ||
ATTENDEE;ROLE=NON-PARTICIPANT;PARTSTAT=DELEGATED;DELEGATED-TO= | ||
"mailto:[email protected]";CN=The Big Cheese:mailto:iamboss | ||
@example.com | ||
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Jane Doe | ||
:mailto:[email protected] | ||
ATTENDEE;PARTSTAT=ACCEPTED:mailto:[email protected] | ||
ATTENDEE;PARTSTAT=DECLINED:mailto:[email protected] | ||
ATTENDEE;PARTSTAT=TENTATIVE:mailto:[email protected] | ||
END:VEVENT | ||
END:VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//PIMUTILS.ORG//NONSGML khal / icalendar //EN | ||
BEGIN:VEVENT | ||
SUMMARY:An Event | ||
DTSTART;TZID=Europe/Berlin:20140409T093000 | ||
DTEND;TZID=Europe/Berlin:20140409T103000 | ||
DTSTAMP:20140401T234817Z | ||
UID:V042MJ8B3SJNFXQOJL6P53OFMHJE8Z3VZWOU | ||
STATUS:CONFIRMED | ||
END:VEVENT | ||
END:VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters