[CalendarServer-changes] [7721] CalendarServer/branches/users/glyph/disable-quota

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 7 02:34:36 PDT 2011


Revision: 7721
          http://trac.macosforge.org/projects/calendarserver/changeset/7721
Author:   glyph at apple.com
Date:     2011-07-07 02:34:36 -0700 (Thu, 07 Jul 2011)
Log Message:
-----------
Change deriveQuota from taking a test ID to taking a test.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/test/test_wrapping.py
    CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/test/util.py
    CalendarServer/branches/users/glyph/disable-quota/txdav/caldav/datastore/test/common.py
    CalendarServer/branches/users/glyph/disable-quota/txdav/caldav/datastore/test/test_file.py
    CalendarServer/branches/users/glyph/disable-quota/txdav/common/datastore/test/util.py

Modified: CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/test/test_wrapping.py
===================================================================
--- CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/test/test_wrapping.py	2011-07-07 09:34:23 UTC (rev 7720)
+++ CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/test/test_wrapping.py	2011-07-07 09:34:36 UTC (rev 7721)
@@ -406,7 +406,7 @@
             "PUT", "wsanchez"
         )
         self.requestUnderTest.stream = MemoryStream(
-            "x" * deriveQuota(self.id()) * 2)
+            "x" * deriveQuota(self) * 2)
         try:
             result = yield calendarObject.http_PUT(self.requestUnderTest)
         except HTTPError, he:

Modified: CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/test/util.py
===================================================================
--- CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/test/util.py	2011-07-07 09:34:23 UTC (rev 7720)
+++ CalendarServer/branches/users/glyph/disable-quota/twistedcaldav/test/util.py	2011-07-07 09:34:36 UTC (rev 7721)
@@ -105,7 +105,7 @@
         hook for subclasses to override to provide different data stores.
         """
         return CommonDataStore(FilePath(config.DocumentRoot), None, True, False,
-                               quota=deriveQuota(self.id()))
+                               quota=deriveQuota(self))
 
 
     def setupCalendars(self):

Modified: CalendarServer/branches/users/glyph/disable-quota/txdav/caldav/datastore/test/common.py
===================================================================
--- CalendarServer/branches/users/glyph/disable-quota/txdav/caldav/datastore/test/common.py	2011-07-07 09:34:23 UTC (rev 7720)
+++ CalendarServer/branches/users/glyph/disable-quota/txdav/caldav/datastore/test/common.py	2011-07-07 09:34:36 UTC (rev 7721)
@@ -1611,7 +1611,7 @@
         L{ICalendarHome.quotaAllowedBytes} should return the configuration value
         passed to the calendar store's constructor.
         """
-        expected = deriveQuota(self.id())
+        expected = deriveQuota(self)
         home = yield self.homeUnderTest()
         actual = home.quotaAllowedBytes()
         self.assertEquals(expected, actual)

Modified: CalendarServer/branches/users/glyph/disable-quota/txdav/caldav/datastore/test/test_file.py
===================================================================
--- CalendarServer/branches/users/glyph/disable-quota/txdav/caldav/datastore/test/test_file.py	2011-07-07 09:34:23 UTC (rev 7720)
+++ CalendarServer/branches/users/glyph/disable-quota/txdav/caldav/datastore/test/test_file.py	2011-07-07 09:34:36 UTC (rev 7721)
@@ -67,7 +67,7 @@
 
     testID = test.id()
     test.calendarStore = CalendarStore(storeRootPath, test.notifierFactory,
-                                       quota=deriveQuota(testID))
+                                       quota=deriveQuota(test))
     test.txn = test.calendarStore.newTransaction(testID + "(old)")
     assert test.calendarStore is not None, "No calendar store?"
 

Modified: CalendarServer/branches/users/glyph/disable-quota/txdav/common/datastore/test/util.py
===================================================================
--- CalendarServer/branches/users/glyph/disable-quota/txdav/common/datastore/test/util.py	2011-07-07 09:34:23 UTC (rev 7720)
+++ CalendarServer/branches/users/glyph/disable-quota/txdav/common/datastore/test/util.py	2011-07-07 09:34:36 UTC (rev 7721)
@@ -139,7 +139,7 @@
             pass
         currentTestID = testCase.id()
         cp = ConnectionPool(self.sharedService.produceConnection)
-        quota = deriveQuota(currentTestID)
+        quota = deriveQuota(testCase)
         store = CommonDataStore(
             cp.connection, notifierFactory, attachmentRoot, quota=quota
         )
@@ -195,7 +195,7 @@
 
 
 
-def deriveQuota(testID):
+def deriveQuota(testCase):
     """
     Derive a distinctive quota number for a specific test, based on its ID.
     This generates a quota which is small enough that tests may trivially exceed
@@ -207,11 +207,11 @@
     state; this allows us to have the test and the infrastructure agree on a
     number.
 
-    @param testID: The identifier for a test, as returned by L{TestCase.id}.
+    @param testCase: The identifier for a test, as returned by L{TestCase.id}.
 
     @type testID: C{str}
     """
-    h = md5(testID)
+    h = md5(testCase.id())
     seed = int(h.hexdigest(), 16)
     r = Random(seed)
     baseline = 2000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110707/fecb4331/attachment.html>


More information about the calendarserver-changes mailing list