[CalendarServer-changes] [14491] CalendarServer/branches/users/sagen/trashcan-5/txdav/common/ datastore

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 2 07:22:32 PST 2015


Revision: 14491
          http://trac.calendarserver.org//changeset/14491
Author:   sagen at apple.com
Date:     2015-03-02 07:22:31 -0800 (Mon, 02 Mar 2015)
Log Message:
-----------
make test deterministic

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/trashcan-5/txdav/common/datastore/sql.py
    CalendarServer/branches/users/sagen/trashcan-5/txdav/common/datastore/test/test_sql.py

Modified: CalendarServer/branches/users/sagen/trashcan-5/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-5/txdav/common/datastore/sql.py	2015-02-28 22:26:20 UTC (rev 14490)
+++ CalendarServer/branches/users/sagen/trashcan-5/txdav/common/datastore/sql.py	2015-03-02 15:22:31 UTC (rev 14491)
@@ -7572,7 +7572,7 @@
 
 
     @classproperty
-    def _selectIsTrashQuery(cls):
+    def _selectIsInTrashQuery(cls):
         obj = cls._objectSchema
         return Select((obj.IS_IN_TRASH, obj.TRASHED), From=obj, Where=obj.RESOURCE_ID == Parameter("resourceID"))
 
@@ -7581,7 +7581,7 @@
     def isInTrash(self):
         returnValue(
             (
-                yield self._selectIsTrashQuery.on(
+                yield self._selectIsInTrashQuery.on(
                     self._txn, resourceID=self._resourceID
                 )
             )[0][0]
@@ -7591,7 +7591,7 @@
     def whenTrashed(self):
         returnValue(
             (
-                yield self._selectIsTrashQuery.on(
+                yield self._selectIsInTrashQuery.on(
                     self._txn, resourceID=self._resourceID
                 )
             )[0][1]

Modified: CalendarServer/branches/users/sagen/trashcan-5/txdav/common/datastore/test/test_sql.py
===================================================================
--- CalendarServer/branches/users/sagen/trashcan-5/txdav/common/datastore/test/test_sql.py	2015-02-28 22:26:20 UTC (rev 14490)
+++ CalendarServer/branches/users/sagen/trashcan-5/txdav/common/datastore/test/test_sql.py	2015-03-02 15:22:31 UTC (rev 14491)
@@ -1983,9 +1983,11 @@
         resourceNames.remove("test.ics")
         newName = resourceNames[0]
 
-        # user01's test.ics -- verify it got split correctly
+        # user01's test.ics -- verify it got split correctly, by making sure
+        # it's got a count other than 20 now
         data = yield self._getResourceData(txn, "user01", "calendar", "test.ics")
-        self.assertTrue("COUNT=15" in data)
+        self.assertTrue("COUNT=" in data)
+        self.assertFalse("COUNT=20" in data)
 
         # user01's new .ics -- verify it got split correctly
         data = yield self._getResourceData(txn, "user01", "calendar", newName)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150302/19356ad2/attachment.html>


More information about the calendarserver-changes mailing list