[CalendarServer-changes] [14936] CalendarServer/trunk/txdav/common/datastore/podding/test/ test_conduit.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Jul 1 07:21:27 PDT 2015


Revision: 14936
          http://trac.calendarserver.org//changeset/14936
Author:   cdaboo at apple.com
Date:     2015-07-01 07:21:26 -0700 (Wed, 01 Jul 2015)
Log Message:
-----------
Include a test for cross-pod attachment size.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/podding/test/test_conduit.py

Modified: CalendarServer/trunk/txdav/common/datastore/podding/test/test_conduit.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/podding/test/test_conduit.py	2015-07-01 14:14:59 UTC (rev 14935)
+++ CalendarServer/trunk/txdav/common/datastore/podding/test/test_conduit.py	2015-07-01 14:21:26 UTC (rev 14936)
@@ -970,10 +970,12 @@
         yield self.commitTransaction(0)
 
         shared_object = yield self.calendarObjectUnderTest(txn=self.theTransactionUnderTest(1), home="puser01", calendar_name="shared-calendar", name="1.ics")
-        attachment, location = yield shared_object.addAttachment(None, MimeType.fromString("text/plain"), "test.txt", MemoryStream("Here is some text."))
+        data = "Here is some text."
+        attachment, location = yield shared_object.addAttachment(None, MimeType.fromString("text/plain"), "test.txt", MemoryStream(data))
         managedID = attachment.managedID()
         from txdav.caldav.datastore.sql_external import ManagedAttachmentExternal
         self.assertTrue(isinstance(attachment, ManagedAttachmentExternal))
+        self.assertEqual(attachment.size(), len(data))
         self.assertTrue("user01/attachments/test" in location)
         yield self.commitTransaction(1)
 
@@ -1005,10 +1007,12 @@
         yield self.commitTransaction(0)
 
         shared_object = yield self.calendarObjectUnderTest(txn=self.theTransactionUnderTest(1), home="puser01", calendar_name="shared-calendar", name="1.ics")
-        attachment, location = yield shared_object.updateAttachment(managedID, MimeType.fromString("text/plain"), "test.txt", MemoryStream("Here is some more text."))
+        data = "Here is some more text."
+        attachment, location = yield shared_object.updateAttachment(managedID, MimeType.fromString("text/plain"), "test.txt", MemoryStream(data))
         managedID = attachment.managedID()
         from txdav.caldav.datastore.sql_external import ManagedAttachmentExternal
         self.assertTrue(isinstance(attachment, ManagedAttachmentExternal))
+        self.assertEqual(attachment.size(), len(data))
         self.assertTrue("user01/attachments/test" in location)
         yield self.commitTransaction(1)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150701/970dcf37/attachment.html>


More information about the calendarserver-changes mailing list