1.1 --- a/imiptools/dates.py Tue Jul 28 00:14:57 2015 +0200
1.2 +++ b/imiptools/dates.py Tue Jul 28 19:27:27 2015 +0200
1.3 @@ -368,6 +368,8 @@
1.4 attr = {"VALUE" : "DATE-TIME"}
1.5 if tzid:
1.6 attr["TZID"] = tzid
1.7 + elif dt.tzname() == "UTC":
1.8 + attr["TZID"] = "UTC"
1.9 return attr
1.10 else:
1.11 return {"VALUE" : "DATE"}
1.12 @@ -376,7 +378,10 @@
1.13
1.14 def get_datetime_item(dt, tzid=None):
1.15
1.16 - "Return an iCalendar-compatible string and attributes for 'dt' and 'tzid'."
1.17 + """
1.18 + Return an iCalendar-compatible string and attributes for 'dt' using any
1.19 + specified 'tzid' to assert a particular time zone.
1.20 + """
1.21
1.22 if not dt:
1.23 return None, None
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/tests/templates/event-request-conflict-utc.txt Tue Jul 28 19:27:27 2015 +0200
2.3 @@ -0,0 +1,34 @@
2.4 +Content-Type: multipart/alternative; boundary="===============0047278175=="
2.5 +MIME-Version: 1.0
2.6 +From: paul.boddie@example.com
2.7 +To: resource-room-confroom@example.com
2.8 +Subject: Invitation!
2.9 +
2.10 +--===============0047278175==
2.11 +Content-Type: text/plain; charset="us-ascii"
2.12 +MIME-Version: 1.0
2.13 +Content-Transfer-Encoding: 7bit
2.14 +
2.15 +This message contains an event.
2.16 +--===============0047278175==
2.17 +MIME-Version: 1.0
2.18 +Content-Transfer-Encoding: 7bit
2.19 +Content-Type: text/calendar; charset="us-ascii"; method="REQUEST"
2.20 +
2.21 +BEGIN:VCALENDAR
2.22 +PRODID:-//imip-agent/test//EN
2.23 +METHOD:REQUEST
2.24 +VERSION:2.0
2.25 +BEGIN:VEVENT
2.26 +ORGANIZER:mailto:paul.boddie@example.com
2.27 +ATTENDEE;ROLE=CHAIR:mailto:paul.boddie@example.com
2.28 +ATTENDEE;RSVP=TRUE:mailto:resource-room-confroom@example.com
2.29 +DTSTAMP:20141125T004600Z
2.30 +DTSTART:20141126T150000Z
2.31 +DTEND:20141126T160000Z
2.32 +SUMMARY:Meeting at 3pm UTC
2.33 +UID:event9@example.com
2.34 +END:VEVENT
2.35 +END:VCALENDAR
2.36 +
2.37 +--===============0047278175==--
3.1 --- a/tests/test_resource_invitation.sh Tue Jul 28 00:14:57 2015 +0200
3.2 +++ b/tests/test_resource_invitation.sh Tue Jul 28 19:27:27 2015 +0200
3.3 @@ -60,13 +60,22 @@
3.4 && echo "Success" \
3.5 || echo "Failed"
3.6
3.7 - "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
3.8 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/event-request-conflict-utc.txt" 2>> $ERROR \
3.9 | "$SHOWMAIL" \
3.10 > out5.tmp
3.11
3.12 grep -q 'METHOD:REPLY' out5.tmp \
3.13 -&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out5.tmp \
3.14 -&& [ `grep 'FREEBUSY;FBTYPE=BUSY' out5.tmp | wc -l` = '1' ] \
3.15 +&& grep -q 'ATTENDEE;PARTSTAT=DECLINED' out5.tmp \
3.16 +&& echo "Success" \
3.17 +|| echo "Failed"
3.18 +
3.19 + "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
3.20 +| "$SHOWMAIL" \
3.21 +> out6.tmp
3.22 +
3.23 + grep -q 'METHOD:REPLY' out6.tmp \
3.24 +&& grep -q 'FREEBUSY;FBTYPE=BUSY:20141126T150000Z/20141126T160000Z' out6.tmp \
3.25 +&& [ `grep 'FREEBUSY;FBTYPE=BUSY' out6.tmp | wc -l` = '1' ] \
3.26 && echo "Success" \
3.27 || echo "Failed"
3.28
3.29 @@ -75,10 +84,10 @@
3.30
3.31 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request.txt" 2>> $ERROR \
3.32 | "$SHOWMAIL" \
3.33 -> out6.tmp
3.34 +> out7.tmp
3.35
3.36 - grep -q 'METHOD:REPLY' out6.tmp \
3.37 -&& ! grep -q '^FREEBUSY' out6.tmp \
3.38 + grep -q 'METHOD:REPLY' out7.tmp \
3.39 +&& ! grep -q '^FREEBUSY' out7.tmp \
3.40 && echo "Success" \
3.41 || echo "Failed"
3.42
3.43 @@ -87,9 +96,9 @@
3.44
3.45 "$RESOURCE_SCRIPT" $ARGS < "$TEMPLATES/fb-request-all.txt" 2>> $ERROR \
3.46 | "$SHOWMAIL" \
3.47 -> out7.tmp
3.48 +> out8.tmp
3.49
3.50 - grep -q 'METHOD:REPLY' out7.tmp \
3.51 -&& ! grep -q '^FREEBUSY' out7.tmp \
3.52 + grep -q 'METHOD:REPLY' out8.tmp \
3.53 +&& ! grep -q '^FREEBUSY' out8.tmp \
3.54 && echo "Success" \
3.55 || echo "Failed"