[CalendarServer-changes] [7449] CalendarServer/branches/users/glyph/new-export/calendarserver/tools
source_changes at macosforge.org
source_changes at macosforge.org
Mon May 16 07:40:56 PDT 2011
Revision: 7449
http://trac.macosforge.org/projects/calendarserver/changeset/7449
Author: glyph at apple.com
Date: 2011-05-16 07:40:56 -0700 (Mon, 16 May 2011)
Log Message:
-----------
First step; At least import and print usage.
Modified Paths:
--------------
CalendarServer/branches/users/glyph/new-export/calendarserver/tools/export.py
CalendarServer/branches/users/glyph/new-export/calendarserver/tools/test/test_export.py
Modified: CalendarServer/branches/users/glyph/new-export/calendarserver/tools/export.py
===================================================================
--- CalendarServer/branches/users/glyph/new-export/calendarserver/tools/export.py 2011-05-16 14:40:45 UTC (rev 7448)
+++ CalendarServer/branches/users/glyph/new-export/calendarserver/tools/export.py 2011-05-16 14:40:56 UTC (rev 7449)
@@ -41,7 +41,6 @@
from twistedcaldav.ical import iCalendarProductID
from twistedcaldav.resource import isCalendarCollectionResource,\
CalendarHomeResource
-from twistedcaldav.static import CalDAVFile
from twistedcaldav.directory.directory import DirectoryService
from calendarserver.tools.util import UsageError
Modified: CalendarServer/branches/users/glyph/new-export/calendarserver/tools/test/test_export.py
===================================================================
--- CalendarServer/branches/users/glyph/new-export/calendarserver/tools/test/test_export.py 2011-05-16 14:40:45 UTC (rev 7448)
+++ CalendarServer/branches/users/glyph/new-export/calendarserver/tools/test/test_export.py 2011-05-16 14:40:56 UTC (rev 7449)
@@ -33,18 +33,19 @@
def test_usageMessage(self):
"""
- The 'usage' message should print something to standard output and exit.
+ The 'usage' message should print something to standard output (and
+ nothing to standard error) and exit.
"""
orig = sys.stdout
orige = sys.stderr
try:
out = sys.stdout = StringIO()
err = sys.stderr = StringIO()
- usage()
+ self.assertRaises(SystemExit, usage)
finally:
sys.stdout = orig
sys.stderr = orige
- self.assertGreaterThan(len(out.getvalue()), 0)
+ self.assertEquals(len(out.getvalue()) > 0, True, "No output.")
self.assertEquals(len(err.getvalue()), 0)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110516/0a6f7733/attachment.html>
More information about the calendarserver-changes
mailing list