[Checkins] SVN: grok/branches/sylvain-testlayers/src/grok/ftests/ Fix a range of simple issues due to the change to testlayer.

Martijn Faassen faassen at startifact.com
Thu Apr 22 18:36:20 EDT 2010


Log message for revision 111286:
  Fix a range of simple issues due to the change to testlayer.
  

Changed:
  U   grok/branches/sylvain-testlayers/src/grok/ftests/rest/localgrants.py
  U   grok/branches/sylvain-testlayers/src/grok/ftests/rest/rest.py
  U   grok/branches/sylvain-testlayers/src/grok/ftests/security/preserve_permissions.py
  U   grok/branches/sylvain-testlayers/src/grok/ftests/test_grok_functional.py

-=-
Modified: grok/branches/sylvain-testlayers/src/grok/ftests/rest/localgrants.py
===================================================================
--- grok/branches/sylvain-testlayers/src/grok/ftests/rest/localgrants.py	2010-04-22 22:35:31 UTC (rev 111285)
+++ grok/branches/sylvain-testlayers/src/grok/ftests/rest/localgrants.py	2010-04-22 22:36:20 UTC (rev 111286)
@@ -12,7 +12,7 @@
   >>> print http(r'''
   ... GET /++rest++mammoth/manfred HTTP/1.1
   ... ''')
-  HTTP/1.1 401 Unauthorized
+  HTTP/1.0 401 Unauthorized
   Content-Length: 0
   Content-Type: text/plain
   WWW-Authenticate: basic realm="Zope"
@@ -29,7 +29,7 @@
   >>> print http(r'''
   ... GET /++rest++mammoth/manfred HTTP/1.1
   ... ''')
-  HTTP/1.1 200 Ok
+  HTTP/1.0 200 Ok
   Content-Length: 7
   Content-Type: text/plain
   <BLANKLINE>

Modified: grok/branches/sylvain-testlayers/src/grok/ftests/rest/rest.py
===================================================================
--- grok/branches/sylvain-testlayers/src/grok/ftests/rest/rest.py	2010-04-22 22:35:31 UTC (rev 111285)
+++ grok/branches/sylvain-testlayers/src/grok/ftests/rest/rest.py	2010-04-22 22:36:20 UTC (rev 111286)
@@ -120,7 +120,7 @@
 methods for the requested resource::
 
   >>> print http('POST /++rest++b/app HTTP/1.1')
-  HTTP/1. 405 Method Not Allowed
+  HTTP/1.0 405 Method Not Allowed
   Allow: GET, PUT
   Content-Length: 18
   Content-Type: text/plain
@@ -128,26 +128,26 @@
   Method Not Allowed
 
   >>> print http('DELETE /++rest++b/app HTTP/1.1')
-  HTTP/1. 405 Method Not Allowed
+  HTTP/1.0 405 Method Not Allowed
+  Content-Length: 18
   Allow: GET, PUT
-  Content-Length: 18
   <BLANKLINE>
   Method Not Allowed
 
   >>> print http('POST /++rest++c/app HTTP/1.1')
-  HTTP/1. 405 Method Not Allowed
-  Allow:
+  HTTP/1.0 405 Method Not Allowed
   Content-Length: 18
   Content-Type: text/plain
+  Allow:
   <BLANKLINE>
   Method Not Allowed
 
 We can also try this with a completely made-up request method, like FROG::
 
   >>> print http('FROG /++rest++b/app HTTP/1.1')
-  HTTP/1. 405 Method Not Allowed
+  HTTP/1.0 405 Method Not Allowed
+  Content-Length: 18
   Allow: GET, PUT
-  Content-Length: 18
   <BLANKLINE>
   Method Not Allowed
 
@@ -155,7 +155,7 @@
 be public::
 
   >>> print http('GET /++rest++e/app/alpha HTTP/1.1')
-  HTTP/1. 200 Ok
+  HTTP/1.0 200 Ok
   Content-Length: 4
   Content-Type: text/plain
   <BLANKLINE>
@@ -164,20 +164,20 @@
 POST, PUT and DELETE however are not public::
 
   >>> print http('POST /++rest++e/app/alpha HTTP/1.1')
-  HTTP/1. 401 Unauthorized
+  HTTP/1.0 401 Unauthorized
   Content-Length: 0
   Content-Type: text/plain
   WWW-Authenticate: basic realm="Zope"
   <BLANKLINE>
 
   >>> print http('PUT /++rest++e/app/alpha HTTP/1.1')
-  HTTP/1. 401 Unauthorized
+  HTTP/1.0 401 Unauthorized
   Content-Length: 0
   WWW-Authenticate: basic realm="Zope"
   <BLANKLINE>
 
   >>> print http('DELETE /++rest++e/app/alpha HTTP/1.1')
-  HTTP/1. 401 Unauthorized
+  HTTP/1.0 401 Unauthorized
   Content-Length: 0
   WWW-Authenticate: basic realm="Zope"
   <BLANKLINE>
@@ -192,7 +192,7 @@
 
   >>> print http_call('POST', 'http://localhost/++rest++f/app/alpha',
   ...                 'this is the POST body')
-  HTTP/1.1 200 Ok
+  HTTP/1.0 200 Ok
   Content-Length: 21
   Content-Type: text/plain
   <BLANKLINE>
@@ -202,7 +202,7 @@
 
   >>> print http_call('PUT', 'http://localhost/++rest++f/app/alpha',
   ...                 'this is the PUT body')
-  HTTP/1.1 200 Ok
+  HTTP/1.0 200 Ok
   Content-Length: 20
   <BLANKLINE>
   this is the PUT body
@@ -211,7 +211,7 @@
 random objects without access:
 
   >>> print http('DELETE /app HTTP/1.1')
-  HTTP/1. 500 Internal Server Error
+  HTTP/1.0 500 Internal Server Error
   Content-Length: 127
   Content-Type: text/html;charset=utf-8
   <BLANKLINE>
@@ -222,7 +222,7 @@
   <BLANKLINE>
 
   >>> print http('DELETE /app/alpha HTTP/1.1')
-  HTTP/1. 500 Internal Server Error
+  HTTP/1.0 500 Internal Server Error
   Content-Length: 127
   Content-Type: text/html;charset=utf-8
   <BLANKLINE>
@@ -235,7 +235,7 @@
  We shouldn't be allowed to PUT either::
 
   >>> print http('PUT /app/beta HTTP/1.1')
-  HTTP/1. 404 Not Found
+  HTTP/1.0 404 Not Found
   Content-Length: 0
 
 XXX shouldn't this really give a FORBIDDEN response?

Modified: grok/branches/sylvain-testlayers/src/grok/ftests/security/preserve_permissions.py
===================================================================
--- grok/branches/sylvain-testlayers/src/grok/ftests/security/preserve_permissions.py	2010-04-22 22:35:31 UTC (rev 111285)
+++ grok/branches/sylvain-testlayers/src/grok/ftests/security/preserve_permissions.py	2010-04-22 22:36:20 UTC (rev 111286)
@@ -10,7 +10,7 @@
   >>> print http(r'''
   ... GET /@@contents.html HTTP/1.1
   ... ''')
-  HTTP/1.1 401 Unauthorized
+  HTTP/1.0 401 Unauthorized
   ...
   WWW-Authenticate: basic realm="Zope"
   ...
@@ -24,7 +24,7 @@
   >>> print http(r'''
   ... GET /app/++etc++site HTTP/1.1
   ... ''')
-  HTTP/1.1 401 Unauthorized
+  HTTP/1.0 401 Unauthorized
   ...
   WWW-Authenticate: basic realm="Zope"
   ...
@@ -43,7 +43,7 @@
   >>> print http(r'''
   ... GET /app/@@contents.html HTTP/1.1
   ... ''')
-  HTTP/1.1 401 Unauthorized
+  HTTP/1.0 401 Unauthorized
   ...
   
 However, if we make a grant, e.g. on the root object, we can access
@@ -57,7 +57,7 @@
   >>> print http(r'''
   ... GET /@@contents.html HTTP/1.1
   ... ''')
-  HTTP/1.1 200 Ok
+  HTTP/1.0 200 Ok
   ...
 
 The default view is accessible::

Modified: grok/branches/sylvain-testlayers/src/grok/ftests/test_grok_functional.py
===================================================================
--- grok/branches/sylvain-testlayers/src/grok/ftests/test_grok_functional.py	2010-04-22 22:35:31 UTC (rev 111285)
+++ grok/branches/sylvain-testlayers/src/grok/ftests/test_grok_functional.py	2010-04-22 22:36:20 UTC (rev 111286)
@@ -58,9 +58,11 @@
 
 def test_suite():
     suite = unittest.TestSuite()
-    for name in ['xmlrpc', 'traversal', 'form', 'url', 'security', 'rest',
-                 'catalog', 'site', 'application', 'viewlet', 'json',
-                 'lifecycle']:
+    for name in [
+        'xmlrpc',
+        'traversal', 'form', 'url', 'security', 'rest',
+        'catalog', 'site', 'application', 'viewlet', 'json',
+        'lifecycle']:
         suite.addTest(suiteFromPackage(name))
     return suite
 



More information about the checkins mailing list