[CalendarServer-changes] [9193] CalendarServer/branches/users/glyph/sharing-api

source_changes at macosforge.org source_changes at macosforge.org
Thu Apr 26 17:08:40 PDT 2012


Revision: 9193
          http://trac.macosforge.org/projects/calendarserver/changeset/9193
Author:   glyph at apple.com
Date:     2012-04-26 17:08:40 -0700 (Thu, 26 Apr 2012)
Log Message:
-----------
basic shareWithUID test

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/sharing-api/txdav/caldav/datastore/test/common.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/sharing-api/

Modified: CalendarServer/branches/users/glyph/sharing-api/txdav/caldav/datastore/test/common.py
===================================================================
--- CalendarServer/branches/users/glyph/sharing-api/txdav/caldav/datastore/test/common.py	2012-04-27 00:07:08 UTC (rev 9192)
+++ CalendarServer/branches/users/glyph/sharing-api/txdav/caldav/datastore/test/common.py	2012-04-27 00:08:40 UTC (rev 9193)
@@ -324,22 +324,22 @@
 
 
     @inlineCallbacks
-    def homeUnderTest(self, txn=None):
+    def homeUnderTest(self, txn=None, name="home1"):
         """
         Get the calendar home detailed by C{requirements['home1']}.
         """
         if txn is None:
             txn = self.transactionUnderTest()
-        returnValue((yield txn.calendarHomeWithUID("home1")))
+        returnValue((yield txn.calendarHomeWithUID(name)))
 
 
     @inlineCallbacks
-    def calendarUnderTest(self, txn=None):
+    def calendarUnderTest(self, txn=None, name="calendar_1", home="home1"):
         """
         Get the calendar detailed by C{requirements['home1']['calendar_1']}.
         """
         returnValue((yield
-            (yield self.homeUnderTest(txn)).calendarWithName("calendar_1"))
+            (yield self.homeUnderTest(txn, home)).calendarWithName(name))
         )
 
 
@@ -984,6 +984,23 @@
 
 
     @inlineCallbacks
+    def test_shareWithUID(self):
+        """
+        L{ICalendar.shareWithUID} will share a calendar with a given home UID.
+        """
+        cal = yield self.calendarUnderTest()
+        OTHER_HOME_UID = "home_splits"
+        newCalName = yield cal.shareWithUID(OTHER_HOME_UID)
+        self.commit()
+        normalCal = yield self.calendarUnderTest()
+        otherCal = yield self.calendarUnderTest(name=newCalName,
+                                                home=OTHER_HOME_UID)
+        self.assertEqual(
+            (yield otherCal.calendarObjectWithName("1.ics")).component(),
+            (yield normalCal.calendarObjectWithName("1.ics")).component())
+
+
+    @inlineCallbacks
     def test_hasCalendarResourceUIDSomewhereElse(self):
         """
         L{ICalendarHome.hasCalendarResourceUIDSomewhereElse} will determine if
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120426/bc5e7e41/attachment-0001.html>


More information about the calendarserver-changes mailing list