[CalendarServer-changes] [15001] CalendarServer/trunk/txdav

source_changes at macosforge.org source_changes at macosforge.org
Mon Jul 27 09:15:01 PDT 2015


Revision: 15001
          http://trac.calendarserver.org//changeset/15001
Author:   cdaboo at apple.com
Date:     2015-07-27 09:15:01 -0700 (Mon, 27 Jul 2015)
Log Message:
-----------
Fix test taking too long.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/caldav/datastore/test/calendar_store/ho/me/home_bad/calendar_bad/1.ics
    CalendarServer/trunk/txdav/caldav/datastore/test/test_file.py
    CalendarServer/trunk/txdav/common/datastore/test/util.py

Modified: CalendarServer/trunk/txdav/caldav/datastore/test/calendar_store/ho/me/home_bad/calendar_bad/1.ics
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/test/calendar_store/ho/me/home_bad/calendar_bad/1.ics	2015-07-27 15:12:16 UTC (rev 15000)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/calendar_store/ho/me/home_bad/calendar_bad/1.ics	2015-07-27 16:15:01 UTC (rev 15001)
@@ -20,11 +20,11 @@
 END:STANDARD
 END:VTIMEZONE
 BEGIN:VEVENT
-DTEND;TZID=US/Pacific:20000324T124500
+DTEND;TZID=US/Pacific:%(now-1)s0324T124500
 UID:uid1
 DTSTAMP:20090326T145447Z
 SUMMARY:Busted
-DTSTART;TZID=US/Pacific:20000324T121500
+DTSTART;TZID=US/Pacific:%(now-1)s0324T121500
 CREATED:20090326T145440Z
 RRULE:FREQ=HOURLY
 END:VEVENT

Modified: CalendarServer/trunk/txdav/caldav/datastore/test/test_file.py
===================================================================
--- CalendarServer/trunk/txdav/caldav/datastore/test/test_file.py	2015-07-27 15:12:16 UTC (rev 15000)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/test_file.py	2015-07-27 16:15:01 UTC (rev 15001)
@@ -65,14 +65,19 @@
     storePath.copyTo(calendarPath)
 
     # Set year values to current year
+    subs = {}
     nowYear = DateTime.getToday().getYear()
+    subs["now"] = nowYear
+    for i in range(1, 10):
+        subs["now-{}".format(i)] = nowYear - 1
+        subs["now+{}".format(i)] = nowYear + 1
     for home in calendarPath.child("ho").child("me").children():
         if not home.basename().startswith("."):
             for calendar in home.children():
                 if not calendar.basename().startswith("."):
                     for resource in calendar.children():
                         if resource.basename().endswith(".ics"):
-                            resource.setContent(resource.getContent() % {"now": nowYear})
+                            resource.setContent(resource.getContent() % subs)
 
     testID = test.id()
     test.counter = 0

Modified: CalendarServer/trunk/txdav/common/datastore/test/util.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/util.py	2015-07-27 15:12:16 UTC (rev 15000)
+++ CalendarServer/trunk/txdav/common/datastore/test/util.py	2015-07-27 16:15:01 UTC (rev 15001)
@@ -546,8 +546,13 @@
     current year.
     """
 
+    subs = {}
     nowYear = DateTime.getToday().getYear()
-    return data % {"now": nowYear}
+    subs["now"] = nowYear
+    for i in range(1, 10):
+        subs["now-{}".format(i)] = nowYear - 1
+        subs["now+{}".format(i)] = nowYear + 1
+    return data % subs
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150727/6cb5012a/attachment-0001.html>


More information about the calendarserver-changes mailing list