[CalendarServer-changes] [7951] CalendarServer/branches/users/glyph/imip-and-admin-html/ calendarserver/webadmin/test/test_resource.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Aug 11 21:49:37 PDT 2011
Revision: 7951
http://trac.macosforge.org/projects/calendarserver/changeset/7951
Author: glyph at apple.com
Date: 2011-08-11 21:49:37 -0700 (Thu, 11 Aug 2011)
Log Message:
-----------
raise HTTPError for non-existent properties
Modified Paths:
--------------
CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/test/test_resource.py
Modified: CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/test/test_resource.py
===================================================================
--- CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/test/test_resource.py 2011-08-12 04:49:26 UTC (rev 7950)
+++ CalendarServer/branches/users/glyph/imip-and-admin-html/calendarserver/webadmin/test/test_resource.py 2011-08-12 04:49:37 UTC (rev 7951)
@@ -36,6 +36,8 @@
from twext.web2.dav.element.rfc3744 import GroupMemberSet
from twext.web2.dav.element.rfc2518 import DisplayName
+from twext.web2.http import HTTPError
+from twext.web2.responsecode import CONFLICT
from twistedcaldav.directory.directory import DirectoryRecord
@@ -253,10 +255,17 @@
return self
+ @inlineCallbacks
def readProperty(self, name, request):
+ yield None
+ if not isinstance(name, tuple):
+ name = name.qname()
if name == DisplayName.qname():
- return DisplayName("The Name To Display")
- return GroupMemberSet()
+ returnValue(DisplayName("The Name To Display"))
+ elif name == GroupMemberSet.qname():
+ returnValue(GroupMemberSet())
+ else:
+ raise HTTPError(CONFLICT)
def getAutoSchedule(self):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110811/f8fac5b7/attachment.html>
More information about the calendarserver-changes
mailing list