[CalendarServer-changes] [11424] CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/ python

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 26 01:17:33 PDT 2013


Revision: 11424
          http://trac.calendarserver.org//changeset/11424
Author:   glyph at apple.com
Date:     2013-06-26 01:17:33 -0700 (Wed, 26 Jun 2013)
Log Message:
-----------
Test for arrays.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/python/launchd.py
    CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/python/test/test_launchd.py

Modified: CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/python/launchd.py
===================================================================
--- CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/python/launchd.py	2013-06-26 08:17:13 UTC (rev 11423)
+++ CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/python/launchd.py	2013-06-26 08:17:33 UTC (rev 11424)
@@ -162,7 +162,7 @@
             result[k] = plainPython(v)
         return result
     elif isinstance(x, LaunchArray):
-        result = []
+        return list(x)
     else:
         return x
 

Modified: CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/python/test/test_launchd.py
===================================================================
--- CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/python/test/test_launchd.py	2013-06-26 08:17:13 UTC (rev 11423)
+++ CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext/python/test/test_launchd.py	2013-06-26 08:17:33 UTC (rev 11424)
@@ -187,7 +187,16 @@
         self.assertRaises(StopIteration, i.next)
 
 
+    def test_plainPython(self):
+        """
+        L{plainPython} converts a L{LaunchArray} into a Python list.
+        """
+        array = LaunchArray(self.testArray)
+        self.assertEquals(plainPython(array),
+                          [b"test-string-1", b"another string.", 4321])
 
+
+
 class SimpleStringConstants(TestCase):
     """
     Tests for bytestring-constants wrapping.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130626/70a13481/attachment.html>


More information about the calendarserver-changes mailing list