<!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>[13025] CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools</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/13025">13025</a></dd>
<dt>Author</dt> <dd>sagen@apple.com</dd>
<dt>Date</dt> <dd>2014-03-28 11:08:37 -0700 (Fri, 28 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix test_purge_old_events.py and remove extra parens</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesuserssagenmove2who4calendarservertoolspurgepy">CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/purge.py</a></li>
<li><a href="#CalendarServerbranchesuserssagenmove2who4calendarservertoolstesttest_purge_old_eventspy">CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/test/test_purge_old_events.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesuserssagenmove2who4calendarservertoolspurgepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/purge.py (13024 => 13025)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/purge.py        2014-03-28 17:59:00 UTC (rev 13024)
+++ CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/purge.py        2014-03-28 18:08:37 UTC (rev 13025)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx"> service.batchSize = batchSize
</span><span class="cx"> service.dryrun = dryrun
</span><span class="cx"> service.verbose = verbose
</span><del>- result = (yield service.doWork())
</del><ins>+ result = yield service.doWork()
</ins><span class="cx"> returnValue(result)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx"> if self.verbose:
</span><span class="cx"> print("(Dry run) Searching for old events...")
</span><span class="cx"> txn = self.store.newTransaction(label="Find old events")
</span><del>- oldEvents = (yield txn.eventsOlderThan(self.cutoff))
</del><ins>+ oldEvents = yield txn.eventsOlderThan(self.cutoff)
</ins><span class="cx"> eventCount = len(oldEvents)
</span><span class="cx"> if self.verbose:
</span><span class="cx"> if eventCount == 0:
</span><span class="lines">@@ -197,8 +197,8 @@
</span><span class="cx"> totalRemoved = 0
</span><span class="cx"> while numEventsRemoved:
</span><span class="cx"> txn = self.store.newTransaction(label="Remove old events")
</span><del>- numEventsRemoved = (yield txn.removeOldEvents(self.cutoff, batchSize=self.batchSize))
- (yield txn.commit())
</del><ins>+ numEventsRemoved = yield txn.removeOldEvents(self.cutoff, batchSize=self.batchSize)
+ yield txn.commit()
</ins><span class="cx"> if numEventsRemoved:
</span><span class="cx"> totalRemoved += numEventsRemoved
</span><span class="cx"> if self.verbose:
</span><span class="lines">@@ -358,7 +358,7 @@
</span><span class="cx"> service.batchSize = limit
</span><span class="cx"> service.dryrun = dryrun
</span><span class="cx"> service.verbose = verbose
</span><del>- result = (yield service.doWork())
</del><ins>+ result = yield service.doWork()
</ins><span class="cx"> returnValue(result)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -366,20 +366,20 @@
</span><span class="cx"> def doWork(self):
</span><span class="cx">
</span><span class="cx"> if self.dryrun:
</span><del>- orphans = (yield self._orphansDryRun())
</del><ins>+ orphans = yield self._orphansDryRun()
</ins><span class="cx"> if self.cutoff is not None:
</span><del>- dropbox = (yield self._dropboxDryRun())
- managed = (yield self._managedDryRun())
</del><ins>+ dropbox = yield self._dropboxDryRun()
+ managed = yield self._managedDryRun()
</ins><span class="cx"> else:
</span><span class="cx"> dropbox = ()
</span><span class="cx"> managed = ()
</span><span class="cx">
</span><span class="cx"> returnValue(self._dryRunSummary(orphans, dropbox, managed))
</span><span class="cx"> else:
</span><del>- total = (yield self._orphansPurge())
</del><ins>+ total = yield self._orphansPurge()
</ins><span class="cx"> if self.cutoff is not None:
</span><del>- total += (yield self._dropboxPurge())
- total += (yield self._managedPurge())
</del><ins>+ total += yield self._dropboxPurge()
+ total += yield self._managedPurge()
</ins><span class="cx"> returnValue(total)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -389,7 +389,7 @@
</span><span class="cx"> if self.verbose:
</span><span class="cx"> print("(Dry run) Searching for orphaned attachments...")
</span><span class="cx"> txn = self.store.newTransaction(label="Find orphaned attachments")
</span><del>- orphans = (yield txn.orphanedAttachments(self.uuid))
</del><ins>+ orphans = yield txn.orphanedAttachments(self.uuid)
</ins><span class="cx"> returnValue(orphans)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -399,7 +399,7 @@
</span><span class="cx"> if self.verbose:
</span><span class="cx"> print("(Dry run) Searching for old dropbox attachments...")
</span><span class="cx"> txn = self.store.newTransaction(label="Find old dropbox attachments")
</span><del>- cutoffs = (yield txn.oldDropboxAttachments(self.cutoff, self.uuid))
</del><ins>+ cutoffs = yield txn.oldDropboxAttachments(self.cutoff, self.uuid)
</ins><span class="cx"> yield txn.commit()
</span><span class="cx">
</span><span class="cx"> returnValue(cutoffs)
</span><span class="lines">@@ -411,7 +411,7 @@
</span><span class="cx"> if self.verbose:
</span><span class="cx"> print("(Dry run) Searching for old managed attachments...")
</span><span class="cx"> txn = self.store.newTransaction(label="Find old managed attachments")
</span><del>- cutoffs = (yield txn.oldManagedAttachments(self.cutoff, self.uuid))
</del><ins>+ cutoffs = yield txn.oldManagedAttachments(self.cutoff, self.uuid)
</ins><span class="cx"> yield txn.commit()
</span><span class="cx">
</span><span class="cx"> returnValue(cutoffs)
</span><span class="lines">@@ -493,7 +493,7 @@
</span><span class="cx"> totalRemoved = 0
</span><span class="cx"> while numOrphansRemoved:
</span><span class="cx"> txn = self.store.newTransaction(label="Remove orphaned attachments")
</span><del>- numOrphansRemoved = (yield txn.removeOrphanedAttachments(self.uuid, batchSize=self.batchSize))
</del><ins>+ numOrphansRemoved = yield txn.removeOrphanedAttachments(self.uuid, batchSize=self.batchSize)
</ins><span class="cx"> yield txn.commit()
</span><span class="cx"> if numOrphansRemoved:
</span><span class="cx"> totalRemoved += numOrphansRemoved
</span><span class="lines">@@ -524,7 +524,7 @@
</span><span class="cx"> totalRemoved = 0
</span><span class="cx"> while numOldRemoved:
</span><span class="cx"> txn = self.store.newTransaction(label="Remove old dropbox attachments")
</span><del>- numOldRemoved = (yield txn.removeOldDropboxAttachments(self.cutoff, self.uuid, batchSize=self.batchSize))
</del><ins>+ numOldRemoved = yield txn.removeOldDropboxAttachments(self.cutoff, self.uuid, batchSize=self.batchSize)
</ins><span class="cx"> yield txn.commit()
</span><span class="cx"> if numOldRemoved:
</span><span class="cx"> totalRemoved += numOldRemoved
</span><span class="lines">@@ -555,7 +555,7 @@
</span><span class="cx"> totalRemoved = 0
</span><span class="cx"> while numOldRemoved:
</span><span class="cx"> txn = self.store.newTransaction(label="Remove old managed attachments")
</span><del>- numOldRemoved = (yield txn.removeOldManagedAttachments(self.cutoff, self.uuid, batchSize=self.batchSize))
</del><ins>+ numOldRemoved = yield txn.removeOldManagedAttachments(self.cutoff, self.uuid, batchSize=self.batchSize)
</ins><span class="cx"> yield txn.commit()
</span><span class="cx"> if numOldRemoved:
</span><span class="cx"> totalRemoved += numOldRemoved
</span><span class="lines">@@ -695,7 +695,7 @@
</span><span class="cx"> service.doimplicit = doimplicit
</span><span class="cx"> service.proxies = proxies
</span><span class="cx"> service.when = when
</span><del>- result = (yield service.doWork())
</del><ins>+ result = yield service.doWork()
</ins><span class="cx"> returnValue(result)
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -710,7 +710,7 @@
</span><span class="cx"> total = 0
</span><span class="cx">
</span><span class="cx"> for uid in self.uids:
</span><del>- count = (yield self._purgeUID(uid))
</del><ins>+ count = yield self._purgeUID(uid)
</ins><span class="cx"> total += count
</span><span class="cx">
</span><span class="cx"> if self.verbose:
</span><span class="lines">@@ -749,7 +749,7 @@
</span><span class="cx">
</span><span class="cx"> # See if calendar home is provisioned
</span><span class="cx"> txn = self.store.newTransaction()
</span><del>- storeCalHome = (yield txn.calendarHomeWithUID(uid))
</del><ins>+ storeCalHome = yield txn.calendarHomeWithUID(uid)
</ins><span class="cx"> calHomeProvisioned = storeCalHome is not None
</span><span class="cx">
</span><span class="cx"> # If in "completely" mode, unshare collections, remove notifications
</span><span class="lines">@@ -761,14 +761,14 @@
</span><span class="cx"> count = 0
</span><span class="cx">
</span><span class="cx"> if calHomeProvisioned:
</span><del>- count = (yield self._cancelEvents(txn, uid, cua))
</del><ins>+ count = yield self._cancelEvents(txn, uid, cua)
</ins><span class="cx">
</span><span class="cx"> # Remove empty calendar collections (and calendar home if no more
</span><span class="cx"> # calendars)
</span><span class="cx"> yield self._removeCalendarHome(uid)
</span><span class="cx">
</span><span class="cx"> # Remove VCards
</span><del>- count += (yield self._removeAddressbookHome(uid))
</del><ins>+ count += yield self._removeAddressbookHome(uid)
</ins><span class="cx">
</span><span class="cx"> if self.proxies and not self.dryrun:
</span><span class="cx"> if self.verbose:
</span><span class="lines">@@ -790,13 +790,13 @@
</span><span class="cx"> else:
</span><span class="cx"> print("Unsharing: %s" % (child.name(),))
</span><span class="cx"> if not self.dryrun:
</span><del>- (yield child.unshare())
</del><ins>+ yield child.unshare()
</ins><span class="cx">
</span><span class="cx"> if not self.dryrun:
</span><del>- (yield storeCalHome.removeUnacceptedShares())
- notificationHome = (yield txn.notificationsWithUID(storeCalHome.uid()))
</del><ins>+ yield storeCalHome.removeUnacceptedShares()
+ notificationHome = yield txn.notificationsWithUID(storeCalHome.uid())
</ins><span class="cx"> if notificationHome is not None:
</span><del>- (yield notificationHome.remove())
</del><ins>+ yield notificationHome.remove()
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -817,15 +817,15 @@
</span><span class="cx">
</span><span class="cx"> count = 0
</span><span class="cx"> txn = self.store.newTransaction()
</span><del>- storeCalHome = (yield txn.calendarHomeWithUID(uid))
- calendarNames = (yield storeCalHome.listCalendars())
</del><ins>+ storeCalHome = yield txn.calendarHomeWithUID(uid)
+ calendarNames = yield storeCalHome.listCalendars()
</ins><span class="cx"> yield txn.commit()
</span><span class="cx">
</span><span class="cx"> for calendarName in calendarNames:
</span><span class="cx">
</span><span class="cx"> txn = self.store.newTransaction()
</span><del>- storeCalHome = (yield txn.calendarHomeWithUID(uid))
- calendar = (yield storeCalHome.calendarWithName(calendarName))
</del><ins>+ storeCalHome = yield txn.calendarHomeWithUID(uid)
+ calendar = yield storeCalHome.calendarWithName(calendarName)
</ins><span class="cx"> childNames = []
</span><span class="cx">
</span><span class="cx"> if self.completely:
</span><span class="lines">@@ -841,17 +841,17 @@
</span><span class="cx"> for childName in childNames:
</span><span class="cx">
</span><span class="cx"> txn = self.store.newTransaction()
</span><del>- storeCalHome = (yield txn.calendarHomeWithUID(uid))
- calendar = (yield storeCalHome.calendarWithName(calendarName))
</del><ins>+ storeCalHome = yield txn.calendarHomeWithUID(uid)
+ calendar = yield storeCalHome.calendarWithName(calendarName)
</ins><span class="cx">
</span><span class="cx"> try:
</span><del>- childResource = (yield calendar.calendarObjectWithName(childName))
</del><ins>+ childResource = yield calendar.calendarObjectWithName(childName)
</ins><span class="cx">
</span><span class="cx"> # Always delete inbox items
</span><span class="cx"> if self.completely or calendar.isInbox():
</span><span class="cx"> action = self.CANCELEVENT_SHOULD_DELETE
</span><span class="cx"> else:
</span><del>- event = (yield childResource.componentForUser())
</del><ins>+ event = yield childResource.componentForUser()
</ins><span class="cx"> action = self._cancelEvent(event, self.when, cua)
</span><span class="cx">
</span><span class="cx"> uri = "/calendars/__uids__/%s/%s/%s" % (storeCalHome.uid(), calendar.name(), childName)
</span><span class="lines">@@ -912,7 +912,7 @@
</span><span class="cx">
</span><span class="cx"> # Remove empty calendar collections (and calendar home if no more
</span><span class="cx"> # calendars)
</span><del>- storeCalHome = (yield txn.calendarHomeWithUID(uid))
</del><ins>+ storeCalHome = yield txn.calendarHomeWithUID(uid)
</ins><span class="cx"> if storeCalHome is not None:
</span><span class="cx"> calendars = list((yield storeCalHome.calendars()))
</span><span class="cx"> remainingCalendars = len(calendars)
</span><span class="lines">@@ -926,7 +926,7 @@
</span><span class="cx"> else:
</span><span class="cx"> print("Deleting calendar: %s" % (calendarName,))
</span><span class="cx"> if not self.dryrun:
</span><del>- (yield storeCalHome.removeChildWithName(calendarName))
</del><ins>+ yield storeCalHome.removeChildWithName(calendarName)
</ins><span class="cx">
</span><span class="cx"> if not remainingCalendars:
</span><span class="cx"> if self.verbose:
</span><span class="lines">@@ -935,7 +935,7 @@
</span><span class="cx"> else:
</span><span class="cx"> print("Deleting calendar home")
</span><span class="cx"> if not self.dryrun:
</span><del>- (yield storeCalHome.remove())
</del><ins>+ yield storeCalHome.remove()
</ins><span class="cx">
</span><span class="cx"> # Commit
</span><span class="cx"> yield txn.commit()
</span><span class="lines">@@ -954,7 +954,7 @@
</span><span class="cx">
</span><span class="cx"> try:
</span><span class="cx"> # Remove VCards
</span><del>- storeAbHome = (yield txn.addressbookHomeWithUID(uid))
</del><ins>+ storeAbHome = yield txn.addressbookHomeWithUID(uid)
</ins><span class="cx"> if storeAbHome is not None:
</span><span class="cx"> for abColl in list((yield storeAbHome.addressbooks())):
</span><span class="cx"> for card in list((yield abColl.addressbookObjects())):
</span><span class="lines">@@ -966,7 +966,7 @@
</span><span class="cx"> else:
</span><span class="cx"> print("Deleting: %s" % (uri,))
</span><span class="cx"> if not self.dryrun:
</span><del>- (yield card.remove())
</del><ins>+ yield card.remove()
</ins><span class="cx"> count += 1
</span><span class="cx"> if self.verbose:
</span><span class="cx"> abName = abColl.name()
</span><span class="lines">@@ -976,7 +976,7 @@
</span><span class="cx"> print("Deleting addressbook: %s" % (abName,))
</span><span class="cx"> if not self.dryrun:
</span><span class="cx"> # Also remove the addressbook collection itself
</span><del>- (yield storeAbHome.removeChildWithName(abColl.name()))
</del><ins>+ yield storeAbHome.removeChildWithName(abColl.name())
</ins><span class="cx">
</span><span class="cx"> if self.verbose:
</span><span class="cx"> if self.dryrun:
</span><span class="lines">@@ -984,7 +984,7 @@
</span><span class="cx"> else:
</span><span class="cx"> print("Deleting addressbook home")
</span><span class="cx"> if not self.dryrun:
</span><del>- (yield storeAbHome.remove())
</del><ins>+ yield storeAbHome.remove()
</ins><span class="cx">
</span><span class="cx"> # Commit
</span><span class="cx"> yield txn.commit()
</span></span></pre></div>
<a id="CalendarServerbranchesuserssagenmove2who4calendarservertoolstesttest_purge_old_eventspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/test/test_purge_old_events.py (13024 => 13025)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/test/test_purge_old_events.py        2014-03-28 17:59:00 UTC (rev 13024)
+++ CalendarServer/branches/users/sagen/move2who-4/calendarserver/tools/test/test_purge_old_events.py        2014-03-28 18:08:37 UTC (rev 13025)
</span><span class="lines">@@ -18,25 +18,22 @@
</span><span class="cx"> Tests for calendarserver.tools.purge
</span><span class="cx"> """
</span><span class="cx">
</span><del>-from calendarserver.tools.purge import PurgeOldEventsService, PurgeAttachmentsService, \
- PurgePrincipalService
</del><ins>+import os
</ins><span class="cx">
</span><ins>+from calendarserver.tools.purge import (
+ PurgeOldEventsService, PurgeAttachmentsService, PurgePrincipalService
+)
</ins><span class="cx"> from pycalendar.datetime import DateTime
</span><span class="cx"> from pycalendar.timezone import Timezone
</span><del>-
</del><span class="cx"> from twext.enterprise.dal.syntax import Update, Delete
</span><del>-from txweb2.http_headers import MimeType
-
</del><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><del>-
</del><span class="cx"> from twistedcaldav.config import config
</span><span class="cx"> from twistedcaldav.test.util import StoreTestCase
</span><span class="cx"> from twistedcaldav.vcard import Component as VCardComponent
</span><del>-
</del><span class="cx"> from txdav.common.datastore.sql_tables import schema
</span><span class="cx"> from txdav.common.datastore.test.util import populateCalendarsFrom
</span><ins>+from txweb2.http_headers import MimeType
</ins><span class="cx">
</span><del>-import os
</del><span class="cx">
</span><span class="cx">
</span><span class="cx"> now = DateTime.getToday().getYear()
</span><span class="lines">@@ -415,16 +412,16 @@
</span><span class="cx"> # Turn off delayed indexing option so we can have some useful tests
</span><span class="cx"> self.patch(config, "FreeBusyIndexDelayedExpand", False)
</span><span class="cx">
</span><del>- self.patch(config.DirectoryService.params, "xmlFile",
- os.path.join(
- os.path.dirname(__file__), "purge", "accounts.xml"
- )
- )
- self.patch(config.ResourceService.params, "xmlFile",
- os.path.join(
- os.path.dirname(__file__), "purge", "resources.xml"
- )
- )
</del><ins>+ # self.patch(config.DirectoryService.params, "xmlFile",
+ # os.path.join(
+ # os.path.dirname(__file__), "purge", "accounts.xml"
+ # )
+ # )
+ # self.patch(config.ResourceService.params, "xmlFile",
+ # os.path.join(
+ # os.path.dirname(__file__), "purge", "resources.xml"
+ # )
+ # )
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -679,9 +676,9 @@
</span><span class="cx"> (yield txn.commit())
</span><span class="cx">
</span><span class="cx"> # Purge home1
</span><del>- total, ignored = (yield PurgePrincipalService.purgeUIDs(self._sqlCalendarStore, self.directory,
</del><ins>+ total = yield PurgePrincipalService.purgeUIDs(self._sqlCalendarStore, self.directory,
</ins><span class="cx"> self.rootResource, ("home1",), verbose=False, proxies=False,
</span><del>- when=DateTime(now, 4, 1, 12, 0, 0, 0, Timezone(utc=True))))
</del><ins>+ when=DateTime(now, 4, 1, 12, 0, 0, 0, Timezone(utc=True)))
</ins><span class="cx">
</span><span class="cx"> # 4 items deleted: 3 events and 1 vcard
</span><span class="cx"> self.assertEquals(total, 4)
</span><span class="lines">@@ -716,8 +713,8 @@
</span><span class="cx"> (yield txn.commit())
</span><span class="cx">
</span><span class="cx"> # Purge home1 completely
</span><del>- total, ignored = (yield PurgePrincipalService.purgeUIDs(self._sqlCalendarStore, self.directory,
- self.rootResource, ("home1",), verbose=False, proxies=False, completely=True))
</del><ins>+ total = yield PurgePrincipalService.purgeUIDs(self._sqlCalendarStore, self.directory,
+ self.rootResource, ("home1",), verbose=False, proxies=False, completely=True)
</ins><span class="cx">
</span><span class="cx"> # 9 items deleted: 8 events and 1 vcard
</span><span class="cx"> self.assertEquals(total, 9)
</span></span></pre>
</div>
</div>
</body>
</html>