[CalendarServer-changes] [5904] CalendarServer/branches/new-store/txcaldav/calendarstore/test/common .py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Jul 14 12:38:44 PDT 2010
Revision: 5904
http://trac.macosforge.org/projects/calendarserver/changeset/5904
Author: cdaboo at apple.com
Date: 2010-07-14 12:38:44 -0700 (Wed, 14 Jul 2010)
Log Message:
-----------
Fix attachment content-types test.
Modified Paths:
--------------
CalendarServer/branches/new-store/txcaldav/calendarstore/test/common.py
Modified: CalendarServer/branches/new-store/txcaldav/calendarstore/test/common.py
===================================================================
--- CalendarServer/branches/new-store/txcaldav/calendarstore/test/common.py 2010-07-14 19:09:21 UTC (rev 5903)
+++ CalendarServer/branches/new-store/txcaldav/calendarstore/test/common.py 2010-07-14 19:38:44 UTC (rev 5904)
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
##
+from twext.web2.http_headers import MimeType
"""
Tests for common calendar store API functions.
@@ -917,7 +918,7 @@
Common logic for attachment-creation tests.
"""
obj = self.calendarObjectUnderTest()
- t = obj.createAttachmentWithName("new.attachment", "text/x-fixture")
+ t = obj.createAttachmentWithName("new.attachment", MimeType("text", "x-fixture"))
t.write("new attachment")
t.write(" text")
t.loseConnection()
@@ -936,8 +937,8 @@
data = yield capture.deferred
self.assertEquals(data, "new attachment text")
contentType = attachment.contentType()
- self.assertIsInstance(contentType, str)
- self.assertEquals(contentType, "text/x-fixture")
+ self.assertIsInstance(contentType, MimeType)
+ self.assertEquals(contentType, MimeType("text", "x-fixture"))
self.assertEquals(attachment.md5(), '50a9f27aeed9247a0833f30a631f1858')
self.assertEquals(
[attachment.name() for attachment in obj.attachments()],
@@ -1000,7 +1001,7 @@
L{ICalendarHome.calendarWithName} or L{ICalendarHome.calendars}.
"""
obj = self.calendarObjectUnderTest()
- t = obj.createAttachmentWithName("new.attachment", "text/plain")
+ t = obj.createAttachmentWithName("new.attachment", MimeType("text", "plain"))
t.write("new attachment text")
t.loseConnection()
self.commit()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100714/e2018291/attachment.html>
More information about the calendarserver-changes
mailing list