[CalendarServer-changes] [5436] CalendarServer/trunk/calendarserver/tools

source_changes at macosforge.org source_changes at macosforge.org
Tue Apr 6 10:50:59 PDT 2010


Revision: 5436
          http://trac.macosforge.org/projects/calendarserver/changeset/5436
Author:   sagen at apple.com
Date:     2010-04-06 10:50:58 -0700 (Tue, 06 Apr 2010)
Log Message:
-----------
Re-enable purge guid tests; encode unicode resource names we get back from indexedSearch()

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/purge.py
    CalendarServer/trunk/calendarserver/tools/test/test_purge.py

Modified: CalendarServer/trunk/calendarserver/tools/purge.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/purge.py	2010-04-01 19:02:26 UTC (rev 5435)
+++ CalendarServer/trunk/calendarserver/tools/purge.py	2010-04-06 17:50:58 UTC (rev 5436)
@@ -287,6 +287,8 @@
 
                 # ...and ignore those that appear *after* the given cutoff
                 for name, uid, type in collection.index().indexedSearch(filter):
+                    if isinstance(name, unicode):
+                        name = name.encode("utf-8")
                     if name in resources:
                         resources.remove(name)
 
@@ -384,6 +386,8 @@
         if collection.isCalendarCollection():
 
             for name, uid, type in collection.index().indexedSearch(filter):
+                if isinstance(name, unicode):
+                    name = name.encode("utf-8")
                 resource = collection.getChild(name)
                 uri = "/calendars/__uids__/%s/%s/%s" % (
                     record.uid,

Modified: CalendarServer/trunk/calendarserver/tools/test/test_purge.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/test/test_purge.py	2010-04-01 19:02:26 UTC (rev 5435)
+++ CalendarServer/trunk/calendarserver/tools/test/test_purge.py	2010-04-06 17:50:58 UTC (rev 5436)
@@ -49,7 +49,7 @@
         self.directory = self.rootResource.getDirectory()
 
     @inlineCallbacks
-    def _test_purgeOldEvents(self):
+    def test_purgeOldEvents(self):
         before = {
             "calendars" : {
                 "__uids__" : {
@@ -416,7 +416,7 @@
 
 
     @inlineCallbacks
-    def _test_purgeProxies(self):
+    def test_purgeProxies(self):
 
         # Set up fake user
         purging = "5D6ABA3C-3446-4340-8083-7E37C5BC0B26"
@@ -468,7 +468,7 @@
         self.assertEquals(len(membersProperty.children), 0)
 
     @inlineCallbacks
-    def _test_purgeExistingGUID(self):
+    def test_purgeExistingGUID(self):
 
         # Deprovisioned user is E9E78C86-4829-4520-A35D-70DDADAB2092
         # Keeper user is        291C2C29-B663-4342-8EA1-A055E6A04D65
@@ -587,7 +587,7 @@
 
 
     @inlineCallbacks
-    def _test_purgeNonExistentGUID(self):
+    def test_purgeNonExistentGUID(self):
 
         before = {
             "calendars" : {
@@ -727,7 +727,7 @@
 
 
     @inlineCallbacks
-    def _test_purgeMultipleNonExistentGUIDs(self):
+    def test_purgeMultipleNonExistentGUIDs(self):
 
         before = {
             "calendars" : {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100406/bb666991/attachment.html>


More information about the calendarserver-changes mailing list