[CalendarServer-changes] [9999] CalendarServer/branches/users/cdaboo/managed-attachments/ twistedcaldav/test/test_icalendar.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 31 13:23:38 PDT 2012


Revision: 9999
          http://trac.calendarserver.org//changeset/9999
Author:   cdaboo at apple.com
Date:     2012-10-31 13:23:38 -0700 (Wed, 31 Oct 2012)
Log Message:
-----------
Missed test from last commit.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/managed-attachments/twistedcaldav/test/test_icalendar.py

Modified: CalendarServer/branches/users/cdaboo/managed-attachments/twistedcaldav/test/test_icalendar.py
===================================================================
--- CalendarServer/branches/users/cdaboo/managed-attachments/twistedcaldav/test/test_icalendar.py	2012-10-31 20:12:45 UTC (rev 9998)
+++ CalendarServer/branches/users/cdaboo/managed-attachments/twistedcaldav/test/test_icalendar.py	2012-10-31 20:23:38 UTC (rev 9999)
@@ -31,6 +31,7 @@
 from twistedcaldav.ical import iCalendarProductID
 from pycalendar.duration import PyCalendarDuration
 from twistedcaldav.dateops import normalizeForExpand
+from pycalendar.value import PyCalendarValue
 
 class iCalendar (twistedcaldav.test.util.TestCase):
     """
@@ -1152,6 +1153,35 @@
             self.assertEqual(result, str(component).replace("\r", ""))
 
 
+    def test_add_property_with_valuetype(self):
+        data = """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890-1
+DTSTART:20071114T000000Z
+DTSTAMP:20080601T120000Z
+END:VEVENT
+END:VCALENDAR
+"""
+        result = """BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890-1
+DTSTART:20071114T000000Z
+ATTACH;VALUE=BINARY:foobar
+DTSTAMP:20080601T120000Z
+END:VEVENT
+END:VCALENDAR
+""".replace("\n", "\r\n")
+
+        component = Component.fromString(data)
+        vevent = component.mainComponent()
+        vevent.addProperty(Property("ATTACH", "foobar", valuetype=PyCalendarValue.VALUETYPE_BINARY))
+        self.assertEqual(str(component), result)
+
+
     def test_add_property(self):
         data = (
             # Simple component
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121031/b9e7bc83/attachment.html>


More information about the calendarserver-changes mailing list