classification
Title: cgi: add more tests
Type: enhancement Stage:
Components: Library (Lib), Tests Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dstanek, quentel, r.david.murray, vstinner, wobsta
Priority: normal Keywords: patch

Created on 2011-01-14 21:34 by vstinner, last changed 2011-03-02 01:09 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
test_cgi.diff quentel, 2011-01-29 20:56 diff file for test_cgi.py
Messages (7)
msg126300 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-01-14 21:34
cgi was recently fixed just before Python 3.2 final, but the module has few tests. More tests should be written.

You can find some examples attached to #4953.
msg126440 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-01-17 22:28
See also #8846: Andre Wobst wrote other tests.
msg126819 - (view) Author: Pierre Quentel (quentel) * Date: 2011-01-22 07:44
Hi,

I have written more tests, but also propose changes to cgi.py : 
- rewrite the parse_qs() and parse_multipart() functions so that they use FieldStorage methods instead of duplicating them
- add a function set_stdout_encoding(encoding), using the IOMix class proposed by Glen Linderman in issue #4953

Should I post the new version of test_cgi.py here and open another issue for the other proposed changes to cgi.py, or use this issue to discuss both ?
msg126937 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-01-24 17:28
Please keep new tests for existing features and new features in separate issues.  A proposed code refactoring should also be a separate issue.
msg127486 - (view) Author: Pierre Quentel (quentel) * Date: 2011-01-29 20:56
Here is the diff file for test_cgi.py
I added a test for a multipart/form-data form with non ASCII data to test the "encoding" parameter of FieldStorage
msg127974 - (view) Author: Pierre Quentel (quentel) * Date: 2011-02-05 06:45
I opened issue #11066 for the code refactoring
msg129832 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-03-01 23:10
I commited your patch with minor changes (e.g. I kept f.close()) to Python 3.3 (r88700) and 3.2 (r88701). Thank you Pierre.
History
Date User Action Args
2011-03-02 01:09:15vstinnersetstatus: open -> closed
nosy: vstinner, dstanek, r.david.murray, wobsta, quentel
resolution: fixed
2011-03-01 23:10:13vstinnersetnosy: vstinner, dstanek, r.david.murray, wobsta, quentel
messages: + msg129832
2011-02-05 06:45:33quentelsetnosy: vstinner, dstanek, r.david.murray, wobsta, quentel
messages: + msg127974
2011-01-29 20:56:13quentelsetfiles: + test_cgi.diff

messages: + msg127486
keywords: + patch
nosy: vstinner, dstanek, r.david.murray, wobsta, quentel
2011-01-24 17:28:53r.david.murraysetnosy: + r.david.murray
messages: + msg126937
2011-01-24 15:41:05dstaneksetnosy: + dstanek
2011-01-22 07:44:48quentelsetnosy: + quentel
messages: + msg126819
2011-01-17 22:28:23vstinnersetnosy: + wobsta
messages: + msg126440
2011-01-16 22:12:48pitrousettype: enhancement
versions: + Python 3.3, - Python 3.2
2011-01-14 21:34:31vstinnercreate