[Zope-Checkins]
SVN: Zope/branches/Zope211-3.4-integration/lib/python/ZPublisher/tests/testHTTPRequest.py
reverted more (probably) accidental changes from r76217
Andreas Zeidler
az at zitc.de
Sun Jun 3 11:34:33 EDT 2007
Log message for revision 76245:
reverted more (probably) accidental changes from r76217
Changed:
U Zope/branches/Zope211-3.4-integration/lib/python/ZPublisher/tests/testHTTPRequest.py
-=-
Modified: Zope/branches/Zope211-3.4-integration/lib/python/ZPublisher/tests/testHTTPRequest.py
===================================================================
--- Zope/branches/Zope211-3.4-integration/lib/python/ZPublisher/tests/testHTTPRequest.py 2007-06-03 15:34:25 UTC (rev 76244)
+++ Zope/branches/Zope211-3.4-integration/lib/python/ZPublisher/tests/testHTTPRequest.py 2007-06-03 15:34:32 UTC (rev 76245)
@@ -1,6 +1,6 @@
import unittest
from urllib import quote_plus
-
+
TEST_LARGEFILE_DATA = '''
--12345
Content-Disposition: form-data; name="file"; filename="file"
@@ -10,7 +10,7 @@
''' % ('test' * 1000)
-class AuthCredentialsTestsa( unittest.TestCase ):
+class AuthCredentialsTests( unittest.TestCase ):
def _getTargetClass(self):
from ZPublisher.HTTPRequest import HTTPRequest
@@ -759,7 +759,26 @@
from zope.publisher.base import DebugFlags
self.assertEqual(getDebug(request), '1')
self.assert_(isinstance(getDebugFromZope3(request), DebugFlags))
+
+ def testMethod(self):
+ TEST_ENVIRON = {
+ 'REQUEST_METHOD': 'GET',
+ 'SERVER_NAME': 'localhost',
+ 'SERVER_PORT': '80',
+ }
+ from StringIO import StringIO
+ from ZPublisher.HTTPRequest import HTTPRequest
+ s = StringIO('')
+ env = TEST_ENVIRON.copy()
+ request = HTTPRequest(s, env, None)
+ self.assertEqual(request.method, 'GET')
+
+ env = TEST_ENVIRON.copy()
+ env['REQUEST_METHOD'] = 'post'
+ request = HTTPRequest(s, env, None)
+ self.assertEqual(request.method, 'POST')
+
def testTrustedProxies(self):
TEST_ENVIRON = {
'REQUEST_METHOD': 'GET',
@@ -794,7 +813,7 @@
def test_suite():
suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(AuthCredentialsTestsa, 'test'))
+ suite.addTest(unittest.makeSuite(AuthCredentialsTests, 'test'))
suite.addTest(unittest.makeSuite(RecordTests, 'test'))
suite.addTest(unittest.makeSuite(ProcessInputsTests, 'test'))
suite.addTest(unittest.makeSuite(RequestTests, 'test'))
More information about the Zope-Checkins
mailing list