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
No unit test for mailcap module #50733
Comments
There is currently no test_mailcap or any other standalone unit test for I would like to be assigned to work on this patch. (Why am I assigning myself to write tests for a small, older module? I'm |
Welcome! Please read the material at http://www.python.org/dev if you haven't Please write the tests and create a diff-patch as outlined in the FAQ. |
Please also identify yourself with your full name. |
Attached is a new file for testing the mailcap module in Python 2.7. Writing the test was a little tricky because the existence and contents of the .mailcap file(s) will vary depending on the system or user. Therefore, the test mostly uses its own version of .mailcap, which I will also submit to this issue. This is the first patch I've ever submitted to Python Core Development. Any feedback is appreciated. |
This is a sample .mailcap I created for the test. It should also go in the Lib/test directory. It begins with a period due to a mailcap file naming convention (see RFC 1524). Is it OK that the file will be semi-hidden? |
Submitting Python 3 version of test. Note that it currently fails due to bpo-8496. It should use the same .mailcap file I submitted earlier. |
Thanks for contributing this; sorry it took so long to get a review. Overall the tests look good (I didn't work through the logic of each test that looks up data; I'm trusting you on that part :) Here are some comments:
Thanks again for working on this. |
Replacing .mailcap with mailcap.txt. Same content, but with more conventional file name. |
r.david.murray: Thanks a lot for your feedback! I've implemented those suggestions and they helped located a bug. (See case 9923.) |
Added ncoghlan to the nosy list - we're reviewing/fixing unit test coverage as part of the sprints at PyconAU. Thanks Gnofi! |
New changeset 69cb66ab61cc by Nick Coghlan in branch 'default': |
New changeset a1bb07d67a24 by Ezio Melotti in branch 'default': |
The buildbots are reporting a test failure on Windows: ====================================================================== Traceback (most recent call last):
File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_mailcap.py", line 74, in test_listmailcapfiles
self.assertEqual(env_mailcaps, mcfiles)
AssertionError: Lists differ: ['/testdir1/.mailcap', '/testd... != ['/testdir1/.mailcap;/testdir2... First differing element 0: First list contains 1 additional elements.
+ ['/testdir1/.mailcap;/testdir2/mailcap'] There's a discrepancy between the test (uses os.pathsep) and the mailcap module (hardcoded to use ':' on all platforms). I suspect the test is actually right and the module is wrong, but I don't know enough about mailcap to be sure. Anyone else? |
There's a bug for that test failure: bpo-9923. I submitted a patch with it. Committing that should fix the failure. |
Ah, cheers - closing this one again. /me wanders off to meta-tracker to ask for a list of "dependency of" and "superseder of" issues in the issue header... |
Any reason why this hasn't been backported to 3.2 or 2.7? |
There are divided opinions about the advisability of backporting tests that are not part of a bug fix. In this case, there is also the fact that it includes a test that fails without a bug fix that was not backported. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: