[CalendarServer-changes] [3830] CalendarServer/trunk/calendarserver/provision/test/test_root.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 11 16:33:58 PDT 2009


Revision: 3830
          http://trac.macosforge.org/projects/calendarserver/changeset/3830
Author:   wsanchez at apple.com
Date:     2009-03-11 16:33:58 -0700 (Wed, 11 Mar 2009)
Log Message:
-----------
Unroll inlineCallbacks.
self.send() doesn't take a None callback.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/provision/test/test_root.py

Modified: CalendarServer/trunk/calendarserver/provision/test/test_root.py
===================================================================
--- CalendarServer/trunk/calendarserver/provision/test/test_root.py	2009-03-11 22:57:24 UTC (rev 3829)
+++ CalendarServer/trunk/calendarserver/provision/test/test_root.py	2009-03-11 23:33:58 UTC (rev 3830)
@@ -268,7 +268,6 @@
         super(SACLCacheTests, self).setUp()
         self.root.resource.responseCache = SACLCacheTests.StubResponseCacheResource()
 
-    @inlineCallbacks
     def test_PROPFIND(self):
         self.root.resource.useSacls = True
 
@@ -293,24 +292,28 @@
             content=body
         )
 
-        response = (yield self.send(request, None))
-        print response
-        if response.code != responsecode.MULTI_STATUS:
-            self.fail("Incorrect response for PROPFIND /principals/: %s" % (response.code,))
+        def gotResponse1(response):
+            if response.code != responsecode.MULTI_STATUS:
+                self.fail("Incorrect response for PROPFIND /principals/: %s" % (response.code,))
 
-        request = SimpleRequest(
-            self.site,
-            "PROPFIND",
-            "/principals/users/dreid/",
-            headers=http_headers.Headers({
-                    'Authorization': ['basic', '%s' % ('dreid:dierd'.encode('base64'),)],
-                    'Content-Type': 'application/xml; charset="utf-8"',
-                    'Depth':'1',
-            }),
-            content=body
-        )
+            request = SimpleRequest(
+                self.site,
+                "PROPFIND",
+                "/principals/users/dreid/",
+                headers=http_headers.Headers({
+                        'Authorization': ['basic', '%s' % ('dreid:dierd'.encode('base64'),)],
+                        'Content-Type': 'application/xml; charset="utf-8"',
+                        'Depth':'1',
+                }),
+                content=body
+            )
 
-        response = (yield self.send(request, None))
-        print response
-        if response.code != responsecode.MULTI_STATUS:
-            self.fail("Incorrect response for PROPFIND /principals/: %s" % (response.code,))
+            d = self.send(request, gotResponse2)
+            return d
+
+        def gotResponse2(response):
+            if response.code != responsecode.MULTI_STATUS:
+                self.fail("Incorrect response for PROPFIND /principals/: %s" % (response.code,))
+
+        d = self.send(request, gotResponse1)
+        return d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090311/6752c7cc/attachment-0001.html>


More information about the calendarserver-changes mailing list