# HG changeset patch # User Paul Boddie # Date 1461081448 -7200 # Node ID d19a1180e39b5a70d80fc3da0933b122fb45a611 # Parent 94f66de18a1795df693ff34fbe3dcc32fcf8d300 Changed the test handler to remove recurrence properties when making a new recurrence and to set the main period of the recurrence appropriately. diff -r 94f66de18a17 -r d19a1180e39b tests/test_handle.py --- a/tests/test_handle.py Tue Apr 19 00:53:59 2016 +0200 +++ b/tests/test_handle.py Tue Apr 19 17:57:28 2016 +0200 @@ -54,6 +54,7 @@ if have_new_recurrence: self.obj["RECURRENCE-ID"] = [(recurrenceid, {})] + self.obj.remove_all(["RDATE", "RRULE"]) # Reply only on behalf of this user. @@ -61,10 +62,19 @@ attendee_attr = self.update_participation(action == "accept" and "ACCEPTED" or "DECLINED") method = "REPLY" - # For counter-proposals, set a new main period for the event. - elif action == "counter": attendee_attr = self.obj.get_value_map("ATTENDEE").get(self.user) + method = "COUNTER" + + # Nothing else is supported. + + else: + return None + + # For counter-proposals or new recurrences, set a new main period for + # the event. + + if action == "counter" or have_new_recurrence: period = self.obj.get_main_period(self.get_tzid()) # Use the existing or configured time zone for the specified @@ -74,12 +84,6 @@ end = to_timezone(get_datetime(end), period.tzid) period = RecurringPeriod(start, end, period.tzid, period.origin, period.get_start_attr(), period.get_end_attr()) self.obj.set_period(period) - method = "COUNTER" - - # Nothing else is supported. - - else: - return None # Where no attendees remain, no message is generated. @@ -111,7 +115,7 @@ try: action, store_type, store_dir, journal_dir, preferences_dir, user = sys.argv[1:7] - if action == "counter": + if len(sys.argv) >= 10: start, end = sys.argv[7:9] i = 9 else: @@ -125,9 +129,9 @@ Need 'accept', 'counter' or 'decline', a store type, a store directory, a -journal directory, a preferences directory, user URI, any counter-proposal -datetimes (see below), plus the appropriate event UID and RECURRENCE-ID (if a -recurrence is involved). +journal directory, a preferences directory, user URI, any counter-proposal or +new recurrence datetimes (see below), plus the appropriate event UID and +RECURRENCE-ID (if a recurrence is involved). The RECURRENCE-ID must be in exactly the form employed by the store, not a different but equivalent representation, if the identifier is to refer to an @@ -138,7 +142,8 @@ store. If 'counter' has been indicated, alternative start and end datetimes are also -required. +required. If a specific recurrence is being separated from an event, such +datetimes are also required in order to set the main period of the recurrence. """ sys.exit(1) diff -r 94f66de18a17 -r d19a1180e39b tests/test_person_invitation_decline_instance.sh --- a/tests/test_person_invitation_decline_instance.sh Tue Apr 19 00:53:59 2016 +0200 +++ b/tests/test_person_invitation_decline_instance.sh Tue Apr 19 17:57:28 2016 +0200 @@ -104,7 +104,7 @@ # Test recurrence declination in the outgoing handler. - "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER" "event26@example.com" "20141011T100000" 2>> $ERROR \ + "$DECLINE_SCRIPT" $DECLINE_ARGS "$USER" "20141011T100000" "20141011T110000" "event26@example.com" "20141011T100000" 2>> $ERROR \ | tee out5.tmp \ | "$OUTGOING_SCRIPT" $ARGS 2>> $ERROR