Log message for revision 30627: Functional.publish() would hang if it got a request_method argument other than GET or HEAD while omitting the stdin argument.
Changed: U Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt U Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/functional.py U Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/testFunctional.py -=- Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt =================================================================== --- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt 2005-06-03 17:28:19 UTC (rev 30626) +++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt 2005-06-03 17:42:38 UTC (rev 30627) @@ -1,3 +1,7 @@ +Unreleased +- Functional.publish() would hang if it got a request_method argument other + than GET or HEAD while omitting the stdin argument. + 0.9.8 (Zope 2.8 edition) - Renamed 'doctest' package to 'zopedoctest' because of name-shadowing issues discovered during integration into Zope 2.8. Tests may still use Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/functional.py =================================================================== --- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/functional.py 2005-06-03 17:28:19 UTC (rev 30626) +++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/functional.py 2005-06-03 17:42:38 UTC (rev 30627) @@ -72,7 +72,7 @@ env['HTTP_AUTHORIZATION'] = "Basic %s" % base64.encodestring(basic) if stdin is None: - stdin = sys.stdin + stdin = StringIO() outstream = StringIO() response = Response(stdout=outstream, stderr=sys.stderr) Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/testFunctional.py =================================================================== --- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/testFunctional.py 2005-06-03 17:28:19 UTC (rev 30626) +++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/testFunctional.py 2005-06-03 17:42:38 UTC (rev 30627) @@ -164,6 +164,32 @@ self.assertEqual(self.folder.new_document.meta_type, 'DTML Document') self.assertEqual(self.folder.new_document(), 'foo') + def testPUTEmpty(self): + # PUT operation without passing stdin should result in empty content + self.setPermissions([change_dtml_documents]) + + response = self.publish(self.folder_path+'/index_html', + request_method='PUT', + basic=self.basic_auth) + + self.assertEqual(response.getStatus(), 204) + self.assertEqual(self.folder.index_html(), '') + + def testPROPFIND(self): + # PROPFIND should work without passing stdin + response = self.publish(self.folder_path+'/index_html', + request_method='PROPFIND', + basic=self.basic_auth) + + self.assertEqual(response.getStatus(), 207) + + def testHEAD(self): + # HEAD should work without passing stdin + response = self.publish(self.folder_path+'/index_html', + request_method='HEAD') + + self.assertEqual(response.getStatus(), 200) + def testSecurityContext(self): # The authenticated user should not change as a result of publish self.assertEqual(getSecurityManager().getUser().getId(), user_name) _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins