[Zope3-checkins] SVN: Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/ added test browser functional tests for new pluggable publisher

Tarek Ziadé tziade at nuxeo.com
Fri Oct 7 10:24:51 EDT 2005


Log message for revision 38890:
  added test browser functional tests for new pluggable publisher

Changed:
  U   Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/ftests.py
  A   Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/httpfactory.txt

-=-
Modified: Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/ftests.py
===================================================================
--- Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/ftests.py	2005-10-07 14:23:41 UTC (rev 38889)
+++ Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/ftests.py	2005-10-07 14:24:51 UTC (rev 38890)
@@ -22,6 +22,7 @@
     return unittest.TestSuite((
         functional.FunctionalDocFileSuite('notfound.txt'),
         functional.FunctionalDocFileSuite('methodnotallowed.txt'),
+        functional.FunctionalDocFileSuite('httpfactory.txt'),
         ))
 
 if __name__ == '__main__':

Added: Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/httpfactory.txt
===================================================================
--- Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/httpfactory.txt	2005-10-07 14:23:41 UTC (rev 38889)
+++ Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/httpfactory.txt	2005-10-07 14:24:51 UTC (rev 38890)
@@ -0,0 +1,72 @@
+$Id:$
+
+HTTPFactory tests
+=================
+
+This tests that httpfactory provide the right publication class,
+for each request type, defined in the configure.zcml with publisher directive.
+
+The publication class is chosen upon the method name,
+the mime type and sometimes some request headers
+
+A regular GET, POST or HEAD 
+
+  >>> print http(r"""
+  ... GET / HTTP/1.1
+  ... """)
+  HTTP/1.1 200 Ok
+  Content-Length: 4402
+  Content-Type: text/html;charset=utf-8
+  ...
+  >>> print http(r"""
+  ... POST / HTTP/1.1
+  ... """)
+  HTTP/1.1 200 Ok
+  Content-Length: 4402
+  Content-Type: text/html;charset=utf-8
+  ...
+  >>> print http(r"""
+  ... HEAD / HTTP/1.1
+  ... """)
+  HTTP/1.1 200 Ok
+  Content-Length: 0
+  Content-Type: text/html;charset=utf-8
+  <BLANKLINE>
+
+A text/xml POST request, wich is an xml-rpc call
+
+  >>> print http(r"""
+  ... POST /RPC2 HTTP/1.0
+  ... Content-Type: text/xml
+  ... """)
+  HTTP/1.0 200 Ok
+  Content-Length: 352
+  Content-Type: text/xml;charset=utf-8
+  ...
+
+A text/xml POST request, with a HTTP_SOAPACTION in the headers,
+wich is an xml-rpc call:
+
+XXX need to create a real SOAP exchange test here
+
+  >>> print http(r"""
+  ... POST /RPC2 HTTP/1.0
+  ... Content-Type: text/xml
+  ... HTTP_SOAPACTION: soap#action
+  ... """)
+  HTTP/1.0 200 Ok
+  Content-Length: 352
+  Content-Type: text/xml;charset=utf-8
+  ...
+
+Unknown request types:
+
+XXX: need more here
+
+  >>> print http(r"""
+  ... POST /BUBA HTTP/1.0
+  ... Content-Type: text/topnotch
+  ... """)
+  HTTP/1.0 404 Not Found
+  ...
+



More information about the Zope3-Checkins mailing list