[CalendarServer-changes] [11173] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Mon May 13 12:59:27 PDT 2013
Revision: 11173
http://trac.calendarserver.org//changeset/11173
Author: cdaboo at apple.com
Date: 2013-05-13 12:59:27 -0700 (Mon, 13 May 2013)
Log Message:
-----------
Make sure home child resources are uncached (via _resourceID index) when removed. Fix tests to match that change.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/scheduling_store/caldav/test/test_resource.py
CalendarServer/trunk/txdav/common/datastore/sql.py
Modified: CalendarServer/trunk/twistedcaldav/scheduling_store/caldav/test/test_resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling_store/caldav/test/test_resource.py 2013-05-13 19:19:53 UTC (rev 11172)
+++ CalendarServer/trunk/twistedcaldav/scheduling_store/caldav/test/test_resource.py 2013-05-13 19:59:27 UTC (rev 11173)
@@ -158,7 +158,7 @@
@inlineCallbacks
def test_missing_default_vevent_calendar(self):
"""
- Test that pickNewDefaultCalendar will create a missing default calendar.
+ Test that readProperty will not create a missing default calendar.
"""
request = SimpleStoreRequest(self, "GET", "/calendars/users/wsanchez/")
@@ -174,8 +174,9 @@
names = [calendarName for calendarName in (yield home._newStoreHome.listCalendars())]
self.assertTrue("calendar" not in names)
+ # Property is empty now
default = yield inbox.readProperty(caldavxml.ScheduleDefaultCalendarURL, request)
- self.assertEqual(str(default.children[0]), "/calendars/__uids__/6423F94A-6B76-4A3A-815B-D52CFD77935D/calendar")
+ self.assertEqual(len(default.children), 0)
yield self.abort()
@@ -183,7 +184,7 @@
@inlineCallbacks
def test_missing_default_vtodo_calendar(self):
"""
- Test that pickNewDefaultCalendar will create a missing default tasks calendar.
+ Test that readProperty will not create a missing default calendar.
"""
request = SimpleStoreRequest(self, "GET", "/calendars/users/wsanchez/")
@@ -199,8 +200,9 @@
names = [calendarName for calendarName in (yield home._newStoreHome.listCalendars())]
self.assertTrue("tasks" not in names)
+ # Property is empty now
default = yield inbox.readProperty(customxml.ScheduleDefaultTasksURL, request)
- self.assertEqual(str(default.children[0]), "/calendars/__uids__/6423F94A-6B76-4A3A-815B-D52CFD77935D/tasks")
+ self.assertEqual(len(default.children), 0)
yield self.abort()
Modified: CalendarServer/trunk/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/sql.py 2013-05-13 19:19:53 UTC (rev 11172)
+++ CalendarServer/trunk/txdav/common/datastore/sql.py 2013-05-13 19:59:27 UTC (rev 11173)
@@ -1772,9 +1772,11 @@
child = yield self.childWithName(name)
if child is None:
raise NoSuchHomeChildError()
+ resourceID = child._resourceID
yield child.remove()
self._children.pop(name, None)
+ self._children.pop(resourceID, None)
@classproperty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130513/c3f88f03/attachment.html>
More information about the calendarserver-changes
mailing list