classification
Title: Improve test coverage for mimetypes module
Type: enhancement Stage: patch review
Components: Tests Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: xtreak
Priority: normal Keywords: patch

Created on 2020-01-11 06:06 by xtreak, last changed 2020-01-13 18:25 by miss-islington.

Pull Requests
URL Status Linked Edit
PR 17949 merged xtreak, 2020-01-11 06:07
PR 17991 open miss-islington, 2020-01-13 18:25
PR 17992 open miss-islington, 2020-01-13 18:25
Messages (3)
msg359781 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2020-01-11 06:06
Currently the test coverage for mimetypes module is at 57% https://codecov.io/gh/python/cpython/src/43682f1e39a3c61f0e8a638b887bcdcbfef766c5/Lib/mimetypes.py . I propose adding the following tests to increase the coverage.

* Add test for case insensitive check of types and extensions.
* Add test for data url with no comma.
* Add test for read_mime_types function.
* Add tests for the mimetypes cli.
msg359810 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2020-01-11 17:00
With the proposed PR the coverage [0] stands at 80% with Windows tests for registry not covered as part of the coverage report. The tests also now use tearDownModule to restore the value of mimetypes.knownfiles which was being accidentally set empty for other tests too as part of the test setup and not restored properly.

[0] https://codecov.io/gh/python/cpython/src/b80c9c384e744788a09176f6f894ea8495e19d6a/Lib/mimetypes.py
msg359912 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2020-01-13 14:39
New changeset d8efc1495194228c3a4cd472200275d6491d8e2d by Karthikeyan Singaravelan in branch 'master':
bpo-39299: Add more tests for mimetypes and its cli. (GH-17949)
https://github.com/python/cpython/commit/d8efc1495194228c3a4cd472200275d6491d8e2d
History
Date User Action Args
2020-01-13 18:25:28miss-islingtonsetpull_requests: + pull_request17395
2020-01-13 18:25:20miss-islingtonsetpull_requests: + pull_request17394
2020-01-13 14:39:43xtreaksetmessages: + msg359912
2020-01-11 17:00:33xtreaksetmessages: + msg359810
2020-01-11 06:07:16xtreaksetkeywords: + patch
stage: patch review
pull_requests: + pull_request17356
2020-01-11 06:06:36xtreakcreate