[CalendarServer-changes] [7562] CalDAVTester/branches/release/CalDAVTester-3.0-dev/src/caldavtest.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Jun 7 16:52:08 PDT 2011
Revision: 7562
http://trac.macosforge.org/projects/calendarserver/changeset/7562
Author: cdaboo at apple.com
Date: 2011-06-07 16:52:07 -0700 (Tue, 07 Jun 2011)
Log Message:
-----------
Cope with GETNEWs happening with multiple resources modified within the same second.
Modified Paths:
--------------
CalDAVTester/branches/release/CalDAVTester-3.0-dev/src/caldavtest.py
Modified: CalDAVTester/branches/release/CalDAVTester-3.0-dev/src/caldavtest.py
===================================================================
--- CalDAVTester/branches/release/CalDAVTester-3.0-dev/src/caldavtest.py 2011-06-06 23:06:02 UTC (rev 7561)
+++ CalDAVTester/branches/release/CalDAVTester-3.0-dev/src/caldavtest.py 2011-06-07 23:52:07 UTC (rev 7562)
@@ -50,6 +50,7 @@
self.end_deletes = []
self.suites = []
self.grabbedlocation = None
+ self.foundnew = []
def missingFeatures(self):
return self.require_features - self.manager.server_info.features
@@ -96,6 +97,7 @@
ok += o
failed += f
ignored += i
+ self.foundnew = []
return (ok, failed, ignored)
def run_test_suite( self, suite, label = "" ):
@@ -279,6 +281,7 @@
latest = 0
request_uri = req.getURI( self.manager.server_info )
+ same = []
for response in tree.findall("{DAV:}response" ):
# Get href for this response
@@ -315,7 +318,26 @@
if value > latest:
hresult = href
latest = value
+ same = []
+ elif value == latest:
+ if len(same) == 0:
+ same.append(hresult)
+ same.append(value)
+
+ if same:
+ high_index = -1
+ for href in same:
+ try:
+ index = self.foundnew.index(href)
+ except ValueError:
+ hresult = href
+ break
+ if index > high_index:
+ hresult = href
+ high_index = index
+ if hresult:
+ self.foundnew.append(hresult)
return hresult
def dowaitcount( self, collection, count, label = ""):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110607/7aba98ec/attachment.html>
More information about the calendarserver-changes
mailing list