[CalendarServer-changes] [5526] CalendarServer/branches/users/wsanchez/transations/txcaldav/ calendarstore

source_changes at macosforge.org source_changes at macosforge.org
Fri Apr 23 09:54:32 PDT 2010


Revision: 5526
          http://trac.macosforge.org/projects/calendarserver/changeset/5526
Author:   glyph at apple.com
Date:     2010-04-23 09:54:31 -0700 (Fri, 23 Apr 2010)
Log Message:
-----------
a few more test successes

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/file.py
    CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/test/test_file.py

Modified: CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/file.py
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/file.py	2010-04-23 16:54:14 UTC (rev 5525)
+++ CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/file.py	2010-04-23 16:54:31 UTC (rev 5526)
@@ -312,11 +312,12 @@
             return None
 
     def calendarObjectWithUID(self, uid):
-        return None
-        # for calendarObjectPath in self.path.children():
-        #     obj = CalendarObject(calendarObjectPath, self)
-        #     if obj.component().resourceUID() == uid:
-        #         return obj
+        # FIXME: This _really_ needs to be inspecting an index, not parsing
+        # every resource.
+        for calendarObjectPath in self.path.children():
+            obj = CalendarObject(calendarObjectPath, self)
+            if obj.component().resourceUID() == uid:
+                return obj
 
     def createCalendarObjectWithName(self, name, component):
         if name.startswith("."):
@@ -340,7 +341,7 @@
             raise NoSuchCalendarObjectError(name)
 
     def removeCalendarObjectWithUID(self, uid):
-        raise NotImplementedError()
+        self.removeCalendarObjectWithName(self.calendarObjectWithUID(uid).path.basename())
 
     def syncToken(self):
         raise NotImplementedError()

Modified: CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/test/test_file.py
===================================================================
--- CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/test/test_file.py	2010-04-23 16:54:14 UTC (rev 5525)
+++ CalendarServer/branches/users/wsanchez/transations/txcaldav/calendarstore/test/test_file.py	2010-04-23 16:54:31 UTC (rev 5526)
@@ -595,14 +595,16 @@
             self.calendar1.removeCalendarObjectWithName, name
         )
 
-    @featureUnimplemented
+
     def test_removeCalendarObjectWithUID_exists(self):
         """
         Remove an existing calendar object.
         """
         for name in calendar1_objectNames:
-            uid = name.rstrip(".ics")
-            assert self.calendar1.calendarObjectWithUID(uid) is not None
+            uid = (u'uid' + name.rstrip(".ics"))
+            
+            self.assertNotIdentical(self.calendar1.calendarObjectWithUID(uid),
+                                    None)
             self.calendar1.removeCalendarObjectWithUID(uid)
             self.assertEquals(
                 self.calendar1.calendarObjectWithUID(uid),
@@ -613,6 +615,7 @@
                 None
             )
 
+
     @featureUnimplemented
     def test_removeCalendarObjectWithUID_absent(self):
         """
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100423/0f7ffc54/attachment.html>


More information about the calendarserver-changes mailing list