<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12867] CalendarServer/branches/users/sagen/move2who-2/txdav</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12867">12867</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-03-10 13:06:08 -0700 (Mon, 10 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Get more tests to pass</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoreschedulingfreebusypy">CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/freebusy.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoreschedulingimplicitpy">CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/implicit.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoreschedulingworkpy">CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/work.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoresqlpy">CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/sql.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoretestattachmentsaccountsxml">CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/attachments/accounts.xml</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoretesttest_attachmentspy">CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/test_attachments.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcommondatastorefilepy">CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/file.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcommondatastorepoddingconduitpy">CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/podding/conduit.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavcommondatastoresqlpy">CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/sql.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavdpstesttest_clientpy">CalendarServer/branches/users/sagen/move2who-2/txdav/dps/test/test_client.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who2txdavwhoaugmentpy">CalendarServer/branches/users/sagen/move2who-2/txdav/who/augment.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoreschedulingfreebusypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/freebusy.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/freebusy.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/freebusy.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -47,6 +47,8 @@
</span><span class="cx"> 
</span><span class="cx"> fbcacher = Memcacher(&quot;FBCache&quot;, pickle=True)
</span><span class="cx"> 
</span><ins>+
+
</ins><span class="cx"> class FBCacheEntry(object):
</span><span class="cx"> 
</span><span class="cx">     CACHE_DAYS_FLOATING_ADJUST = 1
</span><span class="lines">@@ -217,7 +219,7 @@
</span><span class="cx"> 
</span><span class="cx">     # Free busy is per-user
</span><span class="cx">     attendee_uid = calresource.viewerHome().uid()
</span><del>-    attendee_record = yield calresource.directoryService().recordWithUID(attendee_uid)
</del><ins>+    attendee_record = yield calresource.directoryService().recordWithUID(attendee_uid.decode(&quot;utf-8&quot;))
</ins><span class="cx"> 
</span><span class="cx">     # Get the timezone property from the collection.
</span><span class="cx">     tz = calresource.getTimezone()
</span><span class="lines">@@ -237,7 +239,7 @@
</span><span class="cx">         authz_record = organizer_record
</span><span class="cx">         if hasattr(calresource._txn, &quot;_authz_uid&quot;) and calresource._txn._authz_uid != organizer_uid:
</span><span class="cx">             authz_uid = calresource._txn._authz_uid
</span><del>-            authz_record = yield calresource.directoryService().recordWithUID(unicode(authz_uid))
</del><ins>+            authz_record = yield calresource.directoryService().recordWithUID(authz_uid.decode(&quot;utf-8&quot;))
</ins><span class="cx"> 
</span><span class="cx">         # Check if attendee is also the organizer or the delegate doing the request
</span><span class="cx">         if attendee_uid in (organizer_uid, authz_uid):
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoreschedulingimplicitpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/implicit.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/implicit.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/implicit.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -479,7 +479,7 @@
</span><span class="cx">         # Get some useful information from the calendar
</span><span class="cx">         yield self.extractCalendarData()
</span><span class="cx"> 
</span><del>-        self.attendeePrincipal = yield self.calendar_home.directoryService().recordWithUID(self.calendar_home.uid())
</del><ins>+        self.attendeePrincipal = yield self.calendar_home.directoryService().recordWithUID(self.calendar_home.uid().decode(&quot;utf-8&quot;))
</ins><span class="cx">         self.originator = self.attendee = self.attendeePrincipal.canonicalCalendarUserAddress()
</span><span class="cx"> 
</span><span class="cx">         result = (yield self.scheduleWithOrganizer())
</span><span class="lines">@@ -491,7 +491,7 @@
</span><span class="cx">     def extractCalendarData(self):
</span><span class="cx"> 
</span><span class="cx">         # Get the originator who is the owner of the calendar resource being modified
</span><del>-        self.originatorPrincipal = yield self.calendar_home.directoryService().recordWithUID(self.calendar_home.uid())
</del><ins>+        self.originatorPrincipal = yield self.calendar_home.directoryService().recordWithUID(self.calendar_home.uid().decode(&quot;utf-8&quot;))
</ins><span class="cx"> 
</span><span class="cx">         # Pick the canonical CUA:
</span><span class="cx">         self.originator = self.originatorPrincipal.canonicalCalendarUserAddress()
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoreschedulingworkpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/work.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/work.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/scheduling/work.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -45,6 +45,8 @@
</span><span class="cx"> 
</span><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><ins>+
+
</ins><span class="cx"> class ScheduleWorkMixin(object):
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Base class for common schedule work item behavior.
</span><span class="lines">@@ -189,7 +191,7 @@
</span><span class="cx">         try:
</span><span class="cx">             home = (yield self.transaction.calendarHomeWithResourceID(self.homeResourceID))
</span><span class="cx">             resource = (yield home.objectResourceWithID(self.resourceID))
</span><del>-            organizerPrincipal = yield home.directoryService().recordWithUID(home.uid())
</del><ins>+            organizerPrincipal = yield home.directoryService().recordWithUID(home.uid().decode(&quot;utf-8&quot;))
</ins><span class="cx">             organizer = organizerPrincipal.canonicalCalendarUserAddress()
</span><span class="cx">             calendar_old = Component.fromString(self.icalendarTextOld) if self.icalendarTextOld else None
</span><span class="cx">             calendar_new = Component.fromString(self.icalendarTextNew) if self.icalendarTextNew else None
</span><span class="lines">@@ -311,7 +313,7 @@
</span><span class="cx">         try:
</span><span class="cx">             home = (yield self.transaction.calendarHomeWithResourceID(self.homeResourceID))
</span><span class="cx">             resource = (yield home.objectResourceWithID(self.resourceID))
</span><del>-            attendeePrincipal = yield home.directoryService().recordWithUID(home.uid())
</del><ins>+            attendeePrincipal = yield home.directoryService().recordWithUID(home.uid().decode(&quot;utf-8&quot;))
</ins><span class="cx">             attendee = attendeePrincipal.canonicalCalendarUserAddress()
</span><span class="cx">             calendar = (yield resource.componentForUser())
</span><span class="cx">             organizer = calendar.validOrganizerForScheduling()
</span><span class="lines">@@ -382,7 +384,7 @@
</span><span class="cx"> 
</span><span class="cx">         try:
</span><span class="cx">             home = (yield self.transaction.calendarHomeWithResourceID(self.homeResourceID))
</span><del>-            attendeePrincipal = yield home.directoryService().recordWithUID(home.uid())
</del><ins>+            attendeePrincipal = yield home.directoryService().recordWithUID(home.uid().decode(&quot;utf-8&quot;))
</ins><span class="cx">             attendee = attendeePrincipal.canonicalCalendarUserAddress()
</span><span class="cx">             calendar = Component.fromString(self.icalendarText)
</span><span class="cx">             organizer = calendar.validOrganizerForScheduling()
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/sql.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/sql.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/sql.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -2010,7 +2010,7 @@
</span><span class="cx"> 
</span><span class="cx">                 # Find current principal and update modified by details
</span><span class="cx">                 if hasattr(self._txn, &quot;_authz_uid&quot;):
</span><del>-                    authz = yield self.directoryService().recordWithUID(self._txn._authz_uid)
</del><ins>+                    authz = yield self.directoryService().recordWithUID(self._txn._authz_uid.decode(&quot;utf-8&quot;))
</ins><span class="cx">                     prop = Property(&quot;X-CALENDARSERVER-MODIFIED-BY&quot;, authz.canonicalCalendarUserAddress())
</span><span class="cx">                     prop.setParameter(&quot;CN&quot;, authz.displayName())
</span><span class="cx">                     for candidate in authz.calendarUserAddresses():
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoretestattachmentsaccountsxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/attachments/accounts.xml (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/attachments/accounts.xml        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/attachments/accounts.xml        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -18,19 +18,19 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;!DOCTYPE accounts SYSTEM &quot;../../../conf/auth/accounts.dtd&quot;&gt;
</span><span class="cx"> 
</span><del>-&lt;accounts realm=&quot;/Search&quot;&gt;
-  &lt;user&gt;
</del><ins>+&lt;directory realm=&quot;/Search&quot;&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;home1&lt;/uid&gt;
</span><del>-    &lt;guid&gt;home1&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;home1&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;home1&lt;/password&gt;
</span><del>-    &lt;name&gt;Example User 1&lt;/name&gt;
-    &lt;email-address&gt;home1@example.com&lt;/email-address&gt;
-  &lt;/user&gt;
-  &lt;user&gt;
</del><ins>+    &lt;full-name&gt;Example User 1&lt;/full-name&gt;
+    &lt;email&gt;home1@example.com&lt;/email&gt;
+  &lt;/record&gt;
+  &lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;home2&lt;/uid&gt;
</span><del>-    &lt;guid&gt;home2&lt;/guid&gt;
</del><ins>+    &lt;short-name&gt;home2&lt;/short-name&gt;
</ins><span class="cx">     &lt;password&gt;home2&lt;/password&gt;
</span><del>-    &lt;name&gt;Example User 2&lt;/name&gt;
-    &lt;email-address&gt;home2@example.com&lt;/email-address&gt;
-  &lt;/user&gt;
-&lt;/accounts&gt;
</del><ins>+    &lt;full-name&gt;Example User 2&lt;/full-name&gt;
+    &lt;email&gt;home2@example.com&lt;/email&gt;
+  &lt;/record&gt;
+&lt;/directory&gt;
</ins></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcaldavdatastoretesttest_attachmentspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/test_attachments.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/test_attachments.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/caldav/datastore/test/test_attachments.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx"> storePath = FilePath(__file__).parent().child(&quot;calendar_store&quot;)
</span><del>-homeRoot = storePath.child(&quot;ho&quot;).child(&quot;me&quot;).child(&quot;home1&quot;)
</del><ins>+homeRoot = storePath.child(&quot;ho&quot;).child(&quot;me&quot;).child(u&quot;home1&quot;)
</ins><span class="cx"> cal1Root = homeRoot.child(&quot;calendar_1&quot;)
</span><span class="cx"> 
</span><span class="cx"> calendar1_objectNames = [
</span><span class="lines">@@ -597,7 +597,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertTrue(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertNotEqual(quota, 0)
</span><span class="lines">@@ -609,7 +609,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertFalse(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(quota, 0)
</span><span class="lines">@@ -648,7 +648,7 @@
</span><span class="cx">         self.assertTrue(os.path.exists(apath1))
</span><span class="cx">         self.assertTrue(os.path.exists(apath2))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertNotEqual(quota, 0)
</span><span class="lines">@@ -661,7 +661,7 @@
</span><span class="cx">         self.assertFalse(os.path.exists(apath1))
</span><span class="cx">         self.assertFalse(os.path.exists(apath2))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(quota, 0)
</span><span class="lines">@@ -743,7 +743,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertTrue(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertNotEqual(quota, 0)
</span><span class="lines">@@ -755,7 +755,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertTrue(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertNotEqual(quota, 0)
</span><span class="lines">@@ -767,7 +767,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertFalse(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(quota, 0)
</span><span class="lines">@@ -1131,7 +1131,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertTrue(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertNotEqual(quota, 0)
</span><span class="lines">@@ -1143,7 +1143,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertFalse(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(quota, 0)
</span><span class="lines">@@ -1178,7 +1178,7 @@
</span><span class="cx">         self.assertTrue(os.path.exists(apath1))
</span><span class="cx">         self.assertTrue(os.path.exists(apath2))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertNotEqual(quota, 0)
</span><span class="lines">@@ -1191,7 +1191,7 @@
</span><span class="cx">         self.assertFalse(os.path.exists(apath1))
</span><span class="cx">         self.assertFalse(os.path.exists(apath2))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(quota, 0)
</span><span class="lines">@@ -1218,7 +1218,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertTrue(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertNotEqual(quota, 0)
</span><span class="lines">@@ -1230,7 +1230,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertTrue(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertNotEqual(quota, 0)
</span><span class="lines">@@ -1242,7 +1242,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertFalse(os.path.exists(apath))
</span><span class="cx"> 
</span><del>-        home = (yield self.transactionUnderTest().calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield self.transactionUnderTest().calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         quota = (yield home.quotaUsedBytes())
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(quota, 0)
</span><span class="lines">@@ -1363,7 +1363,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     requirements = {
</span><del>-        &quot;home1&quot; : {
</del><ins>+        u&quot;home1&quot; : {
</ins><span class="cx">             &quot;calendar1&quot; : {
</span><span class="cx">                 &quot;1.1.ics&quot; : (PLAIN_ICS % {&quot;year&quot;: now, &quot;uid&quot;: &quot;1.1&quot;, }, metadata,),
</span><span class="cx">                 &quot;1.2.ics&quot; : (ATTACHMENT_ICS % {&quot;year&quot;: now, &quot;uid&quot;: &quot;1.2&quot;, &quot;userid&quot;: &quot;user01&quot;, &quot;dropboxid&quot;: &quot;1.2&quot;}, metadata,),
</span><span class="lines">@@ -1372,7 +1372,7 @@
</span><span class="cx">                 &quot;1.5.ics&quot; : (ATTACHMENT_ICS % {&quot;year&quot;: now, &quot;uid&quot;: &quot;1.5&quot;, &quot;userid&quot;: &quot;user01&quot;, &quot;dropboxid&quot;: &quot;1.4&quot;}, metadata,),
</span><span class="cx">             }
</span><span class="cx">         },
</span><del>-        &quot;home2&quot; : {
</del><ins>+        u&quot;home2&quot; : {
</ins><span class="cx">             &quot;calendar2&quot; : {
</span><span class="cx">                 &quot;2-2.1.ics&quot; : (PLAIN_ICS % {&quot;year&quot;: now, &quot;uid&quot;: &quot;2-2.1&quot;, }, metadata,),
</span><span class="cx">                 &quot;2-2.2.ics&quot; : (ATTACHMENT_ICS % {&quot;year&quot;: now, &quot;uid&quot;: &quot;2-2.2&quot;, &quot;userid&quot;: &quot;user02&quot;, &quot;dropboxid&quot;: &quot;2.2&quot;}, metadata,),
</span><span class="lines">@@ -1488,16 +1488,16 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Add the full set of attachments to be used for testing.
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        yield self._addAttachment(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2_1.txt&quot;)
-        yield self._addAttachment(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2_2.txt&quot;)
-        yield self._addAttachment(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, &quot;1.3&quot;, &quot;attach_1_3.txt&quot;)
-        yield self._addAttachment(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, &quot;1.4&quot;, &quot;attach_1_4.txt&quot;)
-        yield self._addAttachmentProperty(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, &quot;1.4&quot;, &quot;home1&quot;, &quot;attach_1_4.txt&quot;)
</del><ins>+        yield self._addAttachment(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2_1.txt&quot;)
+        yield self._addAttachment(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2_2.txt&quot;)
+        yield self._addAttachment(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, &quot;1.3&quot;, &quot;attach_1_3.txt&quot;)
+        yield self._addAttachment(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, &quot;1.4&quot;, &quot;attach_1_4.txt&quot;)
+        yield self._addAttachmentProperty(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, &quot;1.4&quot;, &quot;home1&quot;, &quot;attach_1_4.txt&quot;)
</ins><span class="cx"> 
</span><del>-        yield self._addAttachment(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, &quot;2.2&quot;, &quot;attach_2_2.txt&quot;)
-        yield self._addAttachmentProperty(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, &quot;1.3&quot;, &quot;home1&quot;, &quot;attach_1_3.txt&quot;)
-        yield self._addAttachmentProperty(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, &quot;1.4&quot;, &quot;home1&quot;, &quot;attach_1_4.txt&quot;)
-        yield self._addAttachmentProperty(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, &quot;1.4&quot;, &quot;home1&quot;, &quot;attach_1_4.txt&quot;)
</del><ins>+        yield self._addAttachment(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, &quot;2.2&quot;, &quot;attach_2_2.txt&quot;)
+        yield self._addAttachmentProperty(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, &quot;1.3&quot;, &quot;home1&quot;, &quot;attach_1_3.txt&quot;)
+        yield self._addAttachmentProperty(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, &quot;1.4&quot;, &quot;home1&quot;, &quot;attach_1_4.txt&quot;)
+        yield self._addAttachmentProperty(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, &quot;1.4&quot;, &quot;home1&quot;, &quot;attach_1_4.txt&quot;)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -1586,7 +1586,7 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Test L{txdav.caldav.datastore.sql.DropboxAttachment.convertToManaged} converts properly to a ManagedAttachment.
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        yield self._addAttachment(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2.txt&quot;)
</del><ins>+        yield self._addAttachment(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2.txt&quot;)
</ins><span class="cx"> 
</span><span class="cx">         txn = self._sqlCalendarStore.newTransaction()
</span><span class="cx"> 
</span><span class="lines">@@ -1616,11 +1616,11 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Test L{txdav.caldav.datastore.sql.ManagedAttachment.newReference} creates a new managed attachment reference.
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        yield self._addAttachment(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, &quot;1.4&quot;, &quot;attach_1_4.txt&quot;)
</del><ins>+        yield self._addAttachment(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, &quot;1.4&quot;, &quot;attach_1_4.txt&quot;)
</ins><span class="cx"> 
</span><span class="cx">         txn = self._sqlCalendarStore.newTransaction()
</span><span class="cx"> 
</span><del>-        home = (yield txn.calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield txn.calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         calendar = (yield home.calendarWithName(&quot;calendar1&quot;))
</span><span class="cx">         event4 = (yield calendar.calendarObjectWithName(&quot;1.4.ics&quot;))
</span><span class="cx">         event5 = (yield calendar.calendarObjectWithName(&quot;1.5.ics&quot;))
</span><span class="lines">@@ -1664,12 +1664,12 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Test L{txdav.caldav.datastore.sql.CalendarObject.convertAttachments} re-writes calendar data.
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        yield self._addAttachment(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2_1.txt&quot;)
-        yield self._addAttachment(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2_2.txt&quot;)
</del><ins>+        yield self._addAttachment(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2_1.txt&quot;)
+        yield self._addAttachment(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, &quot;1.2&quot;, &quot;attach_1_2_2.txt&quot;)
</ins><span class="cx"> 
</span><span class="cx">         txn = self._sqlCalendarStore.newTransaction()
</span><span class="cx"> 
</span><del>-        home = (yield txn.calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield txn.calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         calendar = (yield home.calendarWithName(&quot;calendar1&quot;))
</span><span class="cx">         event = (yield calendar.calendarObjectWithName(&quot;1.2.ics&quot;))
</span><span class="cx"> 
</span><span class="lines">@@ -1688,7 +1688,7 @@
</span><span class="cx"> 
</span><span class="cx">         txn = self._sqlCalendarStore.newTransaction()
</span><span class="cx"> 
</span><del>-        home = (yield txn.calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield txn.calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         calendar = (yield home.calendarWithName(&quot;calendar1&quot;))
</span><span class="cx">         event = (yield calendar.calendarObjectWithName(&quot;1.2.ics&quot;))
</span><span class="cx"> 
</span><span class="lines">@@ -1712,7 +1712,7 @@
</span><span class="cx"> 
</span><span class="cx">         # Convert the second dropbox attachment
</span><span class="cx">         txn = self._sqlCalendarStore.newTransaction()
</span><del>-        home = (yield txn.calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield txn.calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         calendar = (yield home.calendarWithName(&quot;calendar1&quot;))
</span><span class="cx">         event = (yield calendar.calendarObjectWithName(&quot;1.2.ics&quot;))
</span><span class="cx">         dattachment = (yield DropBoxAttachment.load(txn, &quot;1.2.dropbox&quot;, &quot;attach_1_2_2.txt&quot;))
</span><span class="lines">@@ -1722,7 +1722,7 @@
</span><span class="cx">         yield txn.commit()
</span><span class="cx"> 
</span><span class="cx">         txn = self._sqlCalendarStore.newTransaction()
</span><del>-        home = (yield txn.calendarHomeWithUID(&quot;home1&quot;))
</del><ins>+        home = (yield txn.calendarHomeWithUID(u&quot;home1&quot;))
</ins><span class="cx">         calendar = (yield home.calendarWithName(&quot;calendar1&quot;))
</span><span class="cx">         event = (yield calendar.calendarObjectWithName(&quot;1.2.ics&quot;))
</span><span class="cx">         component = (yield event.componentForUser()).mainComponent()
</span><span class="lines">@@ -1760,14 +1760,14 @@
</span><span class="cx">         yield calstore._upgradeDropbox(txn, &quot;1.2.dropbox&quot;)
</span><span class="cx">         yield txn.commit()
</span><span class="cx"> 
</span><del>-        yield self._verifyConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, (&quot;attach_1_2_1.txt&quot;, &quot;attach_1_2_2.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, (&quot;attach_2_2.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, (&quot;attach_1_4.txt&quot;,))
</del><ins>+        yield self._verifyConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, (&quot;attach_1_2_1.txt&quot;, &quot;attach_1_2_2.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, (&quot;attach_2_2.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, (&quot;attach_1_4.txt&quot;,))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -1784,14 +1784,14 @@
</span><span class="cx">         yield calstore._upgradeDropbox(txn, &quot;1.3.dropbox&quot;)
</span><span class="cx">         yield txn.commit()
</span><span class="cx"> 
</span><del>-        yield self._verifyNoConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, (&quot;attach_1_2_1.txt&quot;, &quot;attach_1_2_2.txt&quot;,))
-        yield self._verifyConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, (&quot;attach_2_2.txt&quot;,))
-        yield self._verifyConversion(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, (&quot;attach_1_4.txt&quot;,))
</del><ins>+        yield self._verifyNoConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, (&quot;attach_1_2_1.txt&quot;, &quot;attach_1_2_2.txt&quot;,))
+        yield self._verifyConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, (&quot;attach_2_2.txt&quot;,))
+        yield self._verifyConversion(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, (&quot;attach_1_4.txt&quot;,))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -1808,14 +1808,14 @@
</span><span class="cx">         yield calstore._upgradeDropbox(txn, &quot;1.4.dropbox&quot;)
</span><span class="cx">         yield txn.commit()
</span><span class="cx"> 
</span><del>-        yield self._verifyNoConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, (&quot;attach_1_2_1.txt&quot;, &quot;attach_1_2_2.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
-        yield self._verifyConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, (&quot;attach_2_2.txt&quot;,))
-        yield self._verifyNoConversion(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
-        yield self._verifyConversion(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyConversion(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, (&quot;attach_1_4.txt&quot;,))
</del><ins>+        yield self._verifyNoConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, (&quot;attach_1_2_1.txt&quot;, &quot;attach_1_2_2.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
+        yield self._verifyConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, (&quot;attach_2_2.txt&quot;,))
+        yield self._verifyNoConversion(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
+        yield self._verifyConversion(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyConversion(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, (&quot;attach_1_4.txt&quot;,))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -1830,14 +1830,14 @@
</span><span class="cx">         calstore = CalendarStoreFeatures(self._sqlCalendarStore)
</span><span class="cx">         yield calstore.upgradeToManagedAttachments(2)
</span><span class="cx"> 
</span><del>-        yield self._verifyConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, (&quot;attach_1_2_1.txt&quot;, &quot;attach_1_2_2.txt&quot;,))
-        yield self._verifyConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
-        yield self._verifyConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyConversion(&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyConversion(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, (&quot;attach_2_2.txt&quot;,))
-        yield self._verifyConversion(&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
-        yield self._verifyConversion(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, (&quot;attach_1_4.txt&quot;,))
-        yield self._verifyConversion(&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, (&quot;attach_1_4.txt&quot;,))
</del><ins>+        yield self._verifyConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.2.ics&quot;, (&quot;attach_1_2_1.txt&quot;, &quot;attach_1_2_2.txt&quot;,))
+        yield self._verifyConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
+        yield self._verifyConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.4.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyConversion(u&quot;home1&quot;, &quot;calendar1&quot;, &quot;1.5.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyConversion(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.2.ics&quot;, (&quot;attach_2_2.txt&quot;,))
+        yield self._verifyConversion(u&quot;home2&quot;, &quot;calendar2&quot;, &quot;2-2.3.ics&quot;, (&quot;attach_1_3.txt&quot;,))
+        yield self._verifyConversion(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.2.ics&quot;, (&quot;attach_1_4.txt&quot;,))
+        yield self._verifyConversion(u&quot;home2&quot;, &quot;calendar3&quot;, &quot;2-3.3.ics&quot;, (&quot;attach_1_4.txt&quot;,))
</ins><span class="cx"> 
</span><span class="cx">         # Paths do not exist
</span><span class="cx">         for path in self.paths.values():
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcommondatastorefilepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/file.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/file.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/file.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -700,7 +700,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def directoryRecord(self):
</span><del>-        return self.directoryService().recordWithUID(self.uid())
</del><ins>+        return self.directoryService().recordWithUID(self.uid().decode(&quot;utf-8&quot;))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def retrieveOldShares(self):
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcommondatastorepoddingconduitpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/podding/conduit.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/podding/conduit.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/podding/conduit.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -77,30 +77,30 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def validRequest(self, source_guid, destination_guid):
</del><ins>+    def validRequest(self, source_uid, destination_uid):
</ins><span class="cx">         &quot;&quot;&quot;
</span><del>-        Verify that the specified GUIDs are valid for the request and return the
</del><ins>+        Verify that the specified uids are valid for the request and return the
</ins><span class="cx">         matching directory records.
</span><span class="cx"> 
</span><del>-        @param source_guid: GUID for the user on whose behalf the request is being made
-        @type source_guid: C{str}
-        @param destination_guid: GUID for the user to whom the request is being sent
-        @type destination_guid: C{str}
</del><ins>+        @param source_uid: UID for the user on whose behalf the request is being made
+        @type source_uid: C{str}
+        @param destination_uid: UID for the user to whom the request is being sent
+        @type destination_uid: C{str}
</ins><span class="cx"> 
</span><span class="cx">         @return: L{Deferred} resulting in C{tuple} of L{IStoreDirectoryRecord}
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-        source = yield self.store.directoryService().recordWithUID(source_guid)
</del><ins>+        source = yield self.store.directoryService().recordWithUID(source_uid)
</ins><span class="cx">         if source is None:
</span><del>-            raise DirectoryRecordNotFoundError(&quot;Cross-pod source: {}&quot;.format(source_guid))
</del><ins>+            raise DirectoryRecordNotFoundError(&quot;Cross-pod source: {}&quot;.format(source_uid))
</ins><span class="cx">         if not source.thisServer():
</span><del>-            raise FailedCrossPodRequestError(&quot;Cross-pod source not on this server: {}&quot;.format(source_guid))
</del><ins>+            raise FailedCrossPodRequestError(&quot;Cross-pod source not on this server: {}&quot;.format(source_uid))
</ins><span class="cx"> 
</span><del>-        destination = yield self.store.directoryService().recordWithUID(destination_guid)
</del><ins>+        destination = yield self.store.directoryService().recordWithUID(destination_uid)
</ins><span class="cx">         if destination is None:
</span><del>-            raise DirectoryRecordNotFoundError(&quot;Cross-pod destination: {}&quot;.format(destination_guid))
</del><ins>+            raise DirectoryRecordNotFoundError(&quot;Cross-pod destination: {}&quot;.format(destination_uid))
</ins><span class="cx">         if destination.thisServer():
</span><del>-            raise FailedCrossPodRequestError(&quot;Cross-pod destination on this server: {}&quot;.format(destination_guid))
</del><ins>+            raise FailedCrossPodRequestError(&quot;Cross-pod destination on this server: {}&quot;.format(destination_uid))
</ins><span class="cx"> 
</span><span class="cx">         returnValue((source, destination,))
</span><span class="cx"> 
</span><span class="lines">@@ -167,13 +167,13 @@
</span><span class="cx"> 
</span><span class="cx">         @param homeType: Type of home being shared.
</span><span class="cx">         @type homeType: C{int}
</span><del>-        @param ownerUID: GUID of the sharer.
</del><ins>+        @param ownerUID: UID of the sharer.
</ins><span class="cx">         @type ownerUID: C{str}
</span><span class="cx">         @param ownerID: resource ID of the sharer calendar
</span><span class="cx">         @type ownerID: C{int}
</span><span class="cx">         @param ownerName: owner's name of the sharer calendar
</span><span class="cx">         @type ownerName: C{str}
</span><del>-        @param shareeUID: GUID of the sharee
</del><ins>+        @param shareeUID: UID of the sharee
</ins><span class="cx">         @type shareeUID: C{str}
</span><span class="cx">         @param shareUID: Resource/invite ID for sharee
</span><span class="cx">         @type shareUID: C{str}
</span><span class="lines">@@ -251,11 +251,11 @@
</span><span class="cx"> 
</span><span class="cx">         @param homeType: Type of home being shared.
</span><span class="cx">         @type homeType: C{int}
</span><del>-        @param ownerUID: GUID of the sharer.
</del><ins>+        @param ownerUID: UID of the sharer.
</ins><span class="cx">         @type ownerUID: C{str}
</span><span class="cx">         @param ownerID: resource ID of the sharer calendar
</span><span class="cx">         @type ownerID: C{int}
</span><del>-        @param shareeUID: GUID of the sharee
</del><ins>+        @param shareeUID: UID of the sharee
</ins><span class="cx">         @type shareeUID: C{str}
</span><span class="cx">         @param shareUID: Resource/invite ID for sharee
</span><span class="cx">         @type shareUID: C{str}
</span><span class="lines">@@ -314,9 +314,9 @@
</span><span class="cx"> 
</span><span class="cx">         @param homeType: Type of home being shared.
</span><span class="cx">         @type homeType: C{int}
</span><del>-        @param ownerUID: GUID of the sharer.
</del><ins>+        @param ownerUID: UID of the sharer.
</ins><span class="cx">         @type ownerUID: C{str}
</span><del>-        @param shareeUID: GUID of the recipient
</del><ins>+        @param shareeUID: UID of the recipient
</ins><span class="cx">         @type shareeUID: C{str}
</span><span class="cx">         @param shareUID: Resource/invite ID for recipient
</span><span class="cx">         @type shareUID: C{str}
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavcommondatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/sql.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/sql.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/common/datastore/sql.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -2907,6 +2907,9 @@
</span><span class="cx">     @classmethod
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def homeWithUID(cls, txn, uid, create=False):
</span><ins>+        &quot;&quot;&quot;
+        @param uid: I'm going to assume uid is utf-8 encoded bytes
+        &quot;&quot;&quot;
</ins><span class="cx">         homeObject = yield cls.makeClass(txn, uid)
</span><span class="cx">         if homeObject is not None:
</span><span class="cx">             returnValue(homeObject)
</span><span class="lines">@@ -2915,7 +2918,7 @@
</span><span class="cx">                 returnValue(None)
</span><span class="cx"> 
</span><span class="cx">             # Determine if the user is local or external
</span><del>-            record = yield txn.directoryService().recordWithUID(uid)
</del><ins>+            record = yield txn.directoryService().recordWithUID(uid.decode(&quot;utf-8&quot;))
</ins><span class="cx">             if record is None:
</span><span class="cx">                 raise DirectoryRecordNotFoundError(&quot;Cannot create home for UID since no directory record exists: {}&quot;.format(uid))
</span><span class="cx"> 
</span><span class="lines">@@ -3009,7 +3012,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def directoryRecord(self):
</span><del>-        return self.directoryService().recordWithUID(self.uid())
</del><ins>+        return self.directoryService().recordWithUID(self.uid().decode(&quot;utf-8&quot;))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -6909,6 +6912,9 @@
</span><span class="cx">     @classmethod
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def notificationsWithUID(cls, txn, uid, create):
</span><ins>+        &quot;&quot;&quot;
+        @param uid: I'm going to assume uid is utf-8 encoded bytes
+        &quot;&quot;&quot;
</ins><span class="cx">         rows = yield cls._resourceIDFromUIDQuery.on(txn, uid=uid)
</span><span class="cx"> 
</span><span class="cx">         if rows:
</span><span class="lines">@@ -6916,7 +6922,7 @@
</span><span class="cx">             created = False
</span><span class="cx">         elif create:
</span><span class="cx">             # Determine if the user is local or external
</span><del>-            record = yield txn.directoryService().recordWithUID(uid)
</del><ins>+            record = yield txn.directoryService().recordWithUID(uid.decode(&quot;utf-8&quot;))
</ins><span class="cx">             if record is None:
</span><span class="cx">                 raise DirectoryRecordNotFoundError(&quot;Cannot create home for UID since no directory record exists: {}&quot;.format(uid))
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavdpstesttest_clientpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/dps/test/test_client.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/dps/test/test_client.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/dps/test/test_client.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -25,17 +25,34 @@
</span><span class="cx"> from twisted.trial import unittest
</span><span class="cx"> from txdav.dps.client import DirectoryService
</span><span class="cx"> from txdav.dps.server import DirectoryProxyAMPProtocol
</span><ins>+from txdav.who.directory import CalendarDirectoryServiceMixin
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> testMode = &quot;xml&quot;  # &quot;xml&quot; or &quot;od&quot;
</span><span class="cx"> if testMode == &quot;xml&quot;:
</span><span class="cx">     from txdav.who.xml import DirectoryService as XMLDirectoryService
</span><ins>+
+    # Mix in the calendar-specific service methods
+    class CalendarXMLDirectorySerivce(
+        XMLDirectoryService,
+        CalendarDirectoryServiceMixin
+    ):
+        pass
+
</ins><span class="cx"> elif testMode == &quot;od&quot;:
</span><span class="cx">     odpw = &quot;secret&quot;
</span><span class="cx">     from twext.who.opendirectory import DirectoryService as OpenDirectoryService
</span><span class="cx"> 
</span><ins>+    # Mix in the calendar-specific service methods
+    class CalendarODDirectorySerivce(
+        OpenDirectoryService,
+        CalendarDirectoryServiceMixin
+    ):
+        pass
</ins><span class="cx"> 
</span><span class="cx"> 
</span><ins>+
+
</ins><span class="cx"> class DPSClientTest(unittest.TestCase):
</span><span class="cx"> 
</span><span class="cx">     def setUp(self):
</span><span class="lines">@@ -46,9 +63,9 @@
</span><span class="cx">         # The &quot;remote&quot; directory service
</span><span class="cx">         if testMode == &quot;xml&quot;:
</span><span class="cx">             path = os.path.join(os.path.dirname(__file__), &quot;test.xml&quot;)
</span><del>-            remoteDirectory = XMLDirectoryService(FilePath(path))
</del><ins>+            remoteDirectory = CalendarXMLDirectorySerivce(FilePath(path))
</ins><span class="cx">         elif testMode == &quot;od&quot;:
</span><del>-            remoteDirectory = OpenDirectoryService()
</del><ins>+            remoteDirectory = CalendarODDirectorySerivce()
</ins><span class="cx"> 
</span><span class="cx">         # Connect the two services directly via an IOPump
</span><span class="cx">         client = AMP()
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who2txdavwhoaugmentpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-2/txdav/who/augment.py (12866 => 12867)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-2/txdav/who/augment.py        2014-03-10 18:20:46 UTC (rev 12866)
+++ CalendarServer/branches/users/sagen/move2who-2/txdav/who/augment.py        2014-03-10 20:06:08 UTC (rev 12867)
</span><span class="lines">@@ -19,20 +19,22 @@
</span><span class="cx"> Augmenting Directory Service
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-from twext.who.idirectory import IDirectoryService, RecordType
</del><ins>+from twext.python.log import Logger
</ins><span class="cx"> from twext.who.directory import DirectoryRecord
</span><span class="cx"> from twext.who.directory import DirectoryService as BaseDirectoryService
</span><ins>+from twext.who.idirectory import IDirectoryService, RecordType
</ins><span class="cx"> from twext.who.util import ConstantsContainer
</span><ins>+from twisted.internet.defer import inlineCallbacks, returnValue
+from txdav.common.idirectoryservice import IStoreDirectoryService
+from txdav.who.delegates import RecordType as DelegateRecordType
</ins><span class="cx"> from txdav.who.directory import (
</span><span class="cx">     CalendarDirectoryRecordMixin, CalendarDirectoryServiceMixin
</span><span class="cx"> )
</span><span class="cx"> from txdav.who.idirectory import AutoScheduleMode, FieldName
</span><span class="cx"> from txdav.who.idirectory import RecordType as CalRecordType
</span><del>-from txdav.who.delegates import RecordType as DelegateRecordType
-from twisted.internet.defer import inlineCallbacks, returnValue
</del><span class="cx"> from zope.interface import implementer
</span><span class="cx"> 
</span><del>-from twext.python.log import Logger
</del><ins>+
</ins><span class="cx"> log = Logger()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -66,7 +68,7 @@
</span><span class="cx">         returnValue(augmented)
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-@implementer(IDirectoryService)
</del><ins>+@implementer(IDirectoryService, IStoreDirectoryService)
</ins><span class="cx"> class AugmentedDirectoryService(BaseDirectoryService,
</span><span class="cx">                                 CalendarDirectoryServiceMixin):
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>