Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- some were really TODOs - some no longer applied - some I had to actually fix (test_ftpserver.py mostly) - some were just comments or questions also bonus whitespace fixes
- Loading branch information
1 parent
8b62e5e
commit 1a2f3eb
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
================= | ||
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: ... | ||
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: | ||
|
||
TODO 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: ... | ||
Content-Type: text/xml;charset=utf-8 | ||
... | ||
|
||
Unknown request types: | ||
|
||
TODO need more testing here | ||
|
||
>>> print http(r""" | ||
... POST /BUBA HTTP/1.0 | ||
... Content-Type: text/topnotch | ||
... """) | ||
HTTP/1.0 404 Not Found | ||
... | ||
|