Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgi: add more tests #55120

Closed
vstinner opened this issue Jan 14, 2011 · 7 comments
Closed

cgi: add more tests #55120

vstinner opened this issue Jan 14, 2011 · 7 comments
Labels
stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@vstinner
Copy link
Member

BPO 10911
Nosy @vstinner, @bitdancer, @PierreQuentel
Files
  • test_cgi.diff: diff file for test_cgi.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2011-03-02.01:09:15.767>
    created_at = <Date 2011-01-14.21:34:31.357>
    labels = ['tests', 'type-feature', 'library']
    title = 'cgi: add more tests'
    updated_at = <Date 2011-03-02.01:09:15.767>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2011-03-02.01:09:15.767>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-03-02.01:09:15.767>
    closer = 'vstinner'
    components = ['Library (Lib)', 'Tests']
    creation = <Date 2011-01-14.21:34:31.357>
    creator = 'vstinner'
    dependencies = []
    files = ['20611']
    hgrepos = []
    issue_num = 10911
    keywords = ['patch']
    message_count = 7.0
    messages = ['126300', '126440', '126819', '126937', '127486', '127974', '129832']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'dstanek', 'r.david.murray', 'wobsta', 'quentel']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue10911'
    versions = ['Python 3.3']

    @vstinner
    Copy link
    Member Author

    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 bpo-4953.

    @vstinner vstinner added stdlib Python modules in the Lib dir tests Tests in the Lib/test dir labels Jan 14, 2011
    @pitrou pitrou added the type-feature A feature request or enhancement label Jan 16, 2011
    @vstinner
    Copy link
    Member Author

    See also bpo-8846: Andre Wobst wrote other tests.

    @PierreQuentel
    Copy link
    Mannequin

    PierreQuentel mannequin commented Jan 22, 2011

    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 bpo-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 ?

    @bitdancer
    Copy link
    Member

    Please keep new tests for existing features and new features in separate issues. A proposed code refactoring should also be a separate issue.

    @PierreQuentel
    Copy link
    Mannequin

    PierreQuentel mannequin commented Jan 29, 2011

    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

    @PierreQuentel
    Copy link
    Mannequin

    PierreQuentel mannequin commented Feb 5, 2011

    I opened issue bpo-11066 for the code refactoring

    @vstinner
    Copy link
    Member Author

    vstinner commented Mar 1, 2011

    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.

    @vstinner vstinner closed this as completed Mar 2, 2011
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants