[issue19990] Add unittests for imghdr module
Roundup Robot added the comment: New changeset e2d013e90e88 by Ned Deily in branch '2.7': Issue #19990: Install test/imghdrdata. http://hg.python.org/cpython/rev/e2d013e90e88 New changeset 5fbe155e62b0 by Ned Deily in branch '3.3': Issue #19990: Install test/imghdrdata. http://hg.python.org/cpython/rev/5fbe155e62b0 New changeset b41ba99a276c by Ned Deily in branch 'default': Issue #19990: Install test/imghdrdata. http://hg.python.org/cpython/rev/b41ba99a276c -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Claudiu.Popa added the comment: Hello! Here's the new version of the patch, with tests proposed by Serhiy. -- Added file: http://bugs.python.org/file33731/test_imghdr_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Serhiy Storchaka added the comment: Looks as you forgot to include some test files in the patch. And these files are too large. Much smaller images would be enough. For example you can use python.org icon: http://www.python.org/favicon.ico. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Claudiu.Popa added the comment: Here's a smaller patch. Serhiy, what test files are missing? -- Added file: http://bugs.python.org/file33733/test_imghdr_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Serhiy Storchaka added the comment: Last patch contains only pbm and xbm test files, while test_imghdr expects 11 different image files: png, gif, bmp, etc. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Claudiu.Popa added the comment: Ah, I understand now. Maybe it is related to the fact that I used `hg diff --git`? Doing the following works for me, both Windows and FreeBsd and all the files are present afterwards: 1. hg diff --git patch 2. hg import --no-commit patch Although I'm not sure why it doesn't work in your case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Serhiy Storchaka added the comment: Oh, yes, my bad. I used the patch utility. Sorry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Roundup Robot added the comment: New changeset b28909d501c0 by Serhiy Storchaka in branch '2.7': Issue #19990: Added tests for the imghdr module. http://hg.python.org/cpython/rev/b28909d501c0 New changeset fde9e9832749 by Serhiy Storchaka in branch '3.3': Issue #19990: Added tests for the imghdr module. http://hg.python.org/cpython/rev/fde9e9832749 New changeset 94813eab5a58 by Serhiy Storchaka in branch 'default': Issue #19990: Added tests for the imghdr module. http://hg.python.org/cpython/rev/94813eab5a58 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Serhiy Storchaka added the comment: Thank you Claudiu. I have reorganized tests somewhat and added new test for file position. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Serhiy Storchaka added the comment: In general the patch LGTM, but additional tests can be added. Needed various tests for imghdr.what() arguments: * First argument is bytes, int or None. * First argument is a name of non-existent file. * First argument is text stream. * First argument is output stream. * First argument is closed stream. * First argument is non-seekable stream. * Second argument is bytearray. * Second argument is str. * Second argument is None. Try to insert test function which handles one of already supported format at the front of imghdr.test. -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka stage: - patch review versions: +Python 2.7, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Claudiu.Popa added the comment: Hello. Here's a new version which uses real image files as testing data. -- Added file: http://bugs.python.org/file33552/test_imghdr_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Martin Vignali added the comment: I made a simple exr file with the lib Exr (it's a half float ZIP16 RGBA file), in order to add real exr file to the unit test. When use with the patch i made here http://bugs.python.org/issue20295 , this sample file return 'exr'. Sorry, i don't know how to create an update version of your patch (i just start to use mercurial), so i just upload the sample. -- nosy: +mvignali Added file: http://bugs.python.org/file33555/python.exr ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
New submission from Claudiu.Popa: Hello! The following patch adds unit tests for the previously untested `imghdr` module. -- components: Tests files: test_imghdr.patch keywords: patch messages: 206262 nosy: Claudiu.Popa priority: normal severity: normal status: open title: Add unittests for imghdr module type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file33155/test_imghdr.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Vajrasky Kok added the comment: Beside my review, I think we need one more test that tests the invalid image file, for example file with header b'cutecat'. -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19990] Add unittests for imghdr module
Claudiu.Popa added the comment: Thanks for the review, Vajrasky! Here's the updated version. -- Added file: http://bugs.python.org/file33157/test_imghdr.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19990 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com