Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
Add a test to verify a group removed attendee gets a cancel message. …
Browse files Browse the repository at this point in the history
…Use mix-in class for tests that need to do iCalendar date-time substitutions.

git-svn-id: https://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk@14933 e27351fd-9f3e-4f54-a53b-843176b1656c
  • Loading branch information
cyrusdaboo committed Jun 30, 2015
1 parent e2b9931 commit 342814b
Show file tree
Hide file tree
Showing 5 changed files with 463 additions and 487 deletions.
31 changes: 16 additions & 15 deletions txdav/caldav/datastore/test/test_queue_scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
from twext.python.clsprop import classproperty
from twistedcaldav.config import config
from txdav.caldav.datastore.scheduling.work import ScheduleWorkMixin
from txdav.caldav.datastore.test.util import CommonStoreTests
from txdav.common.datastore.test.util import componentUpdate
from twistedcaldav.ical import normalize_iCalStr
from txdav.caldav.datastore.test.util import CommonStoreTests, \
DateTimeSubstitutionsMixin

class BaseQueueSchedulingTests(CommonStoreTests):
class BaseQueueSchedulingTests(CommonStoreTests, DateTimeSubstitutionsMixin):

"""
Test store-based calendar sharing.
Expand All @@ -41,6 +40,8 @@ def setUp(self):
self.patch(config.Scheduling.Options.WorkQueues, "AttendeeRefreshBatchDelaySeconds", 1)
self.patch(config.Scheduling.Options.WorkQueues, "AttendeeRefreshBatchIntervalSeconds", 1)

self.setupDateTimeValues()


@classproperty(cache=False)
def requirements(cls): #@NoSelf
Expand Down Expand Up @@ -87,7 +88,7 @@ def _testOneResource(self, home, calendar_name, data):
self.assertEqual(len(objs), 1)

caldata = yield objs[0].componentForUser()
self.assertEqual(normalize_iCalStr(caldata), normalize_iCalStr(componentUpdate(data)))
self.assertEqualCalendarData(caldata, data.format(**self.dtsubs))



Expand All @@ -104,7 +105,7 @@ def test_invite_reply(self):
PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
BEGIN:VEVENT
UID:12345-67890
DTSTART:{now}T000000Z
DTSTART:{nowDate}T000000Z
DURATION:PT1H
ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
ATTENDEE:mailto:user02@example.com
Expand All @@ -120,7 +121,7 @@ def test_invite_reply(self):
PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
BEGIN:VEVENT
UID:12345-67890
DTSTART:{now}T000000Z
DTSTART:{nowDate}T000000Z
DURATION:PT1H
ATTENDEE;CN=User 01;EMAIL=user01@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user01
ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:x-uid:user02
Expand All @@ -137,7 +138,7 @@ def test_invite_reply(self):
METHOD:REQUEST
BEGIN:VEVENT
UID:12345-67890
DTSTART:{now}T000000Z
DTSTART:{nowDate}T000000Z
DURATION:PT1H
ATTENDEE;CN=User 01;EMAIL=user01@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user01
ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE:urn:x-uid:user02
Expand All @@ -153,7 +154,7 @@ def test_invite_reply(self):
PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
BEGIN:VEVENT
UID:12345-67890
DTSTART:{now}T000000Z
DTSTART:{nowDate}T000000Z
DURATION:PT1H
ATTENDEE;CN=User 01;EMAIL=user01@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user01
ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE:urn:x-uid:user02
Expand All @@ -170,7 +171,7 @@ def test_invite_reply(self):
PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
BEGIN:VEVENT
UID:12345-67890
DTSTART:{now}T000000Z
DTSTART:{nowDate}T000000Z
DURATION:PT1H
ATTENDEE;CN=User 01;EMAIL=user01@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user01
ATTENDEE;CN=User 02;EMAIL=user02@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user02
Expand All @@ -186,7 +187,7 @@ def test_invite_reply(self):
PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
BEGIN:VEVENT
UID:12345-67890
DTSTART:{now}T000000Z
DTSTART:{nowDate}T000000Z
DURATION:PT1H
ATTENDEE;CN=User 01;EMAIL=user01@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user01
ATTENDEE;CN=User 02;EMAIL=user02@example.com;PARTSTAT=ACCEPTED;SCHEDULE-STATUS=2.0:urn:x-uid:user02
Expand All @@ -203,7 +204,7 @@ def test_invite_reply(self):
METHOD:REPLY
BEGIN:VEVENT
UID:12345-67890
DTSTART:{now}T000000Z
DTSTART:{nowDate}T000000Z
DURATION:PT1H
ATTENDEE;CN=User 02;EMAIL=user02@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user02
DTSTAMP:20051222T210507Z
Expand All @@ -219,7 +220,7 @@ def test_invite_reply(self):
PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
BEGIN:VEVENT
UID:12345-67890
DTSTART:{now}T000000Z
DTSTART:{nowDate}T000000Z
DURATION:PT1H
ATTENDEE;CN=User 01;EMAIL=user01@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user01
ATTENDEE;CN=User 02;EMAIL=user02@example.com;PARTSTAT=ACCEPTED:urn:x-uid:user02
Expand All @@ -232,7 +233,7 @@ def test_invite_reply(self):

waitForWork = ScheduleWorkMixin.allDone()
calendar = yield self.calendarUnderTest(home="user01", name="calendar")
yield calendar.createCalendarObjectWithName("data1.ics", componentUpdate(data1))
yield calendar.createCalendarObjectWithName("data1.ics", data1.format(**self.dtsubs))
yield self.commit()

yield waitForWork
Expand All @@ -244,7 +245,7 @@ def test_invite_reply(self):

waitForWork = ScheduleWorkMixin.allDone()
cobj = yield self._getOneResource("user02", "calendar")
yield cobj.setComponent(componentUpdate(data5))
yield cobj.setComponent(data5.format(**self.dtsubs))
yield self.commit()

yield waitForWork
Expand Down
Loading

0 comments on commit 342814b

Please sign in to comment.