This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Al.Sweigart
Recipients Al.Sweigart
Date 2015-01-09.08:15:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1420791360.73.0.110066531981.issue23205@psf.upfronthosting.co.za>
In-reply-to
Content
GrepDialog.py's findfiles() method lacks a unit test.

The comments in the unit test stub in test_grep.py correctly notes that since findfiles() method does not rely on the GrepDialog class, it can be made into a function.

The attached patch does the following:

- Moves findfiles() to be a function in the GrepDialog.py module.
- Adds a unit test for findfiles()
- Adds sensible default arguments
- As suggested by the previous stub comments, findfiles() returns a generator instead of a full list
- Changes 'list' and 'dir' names since those are built-ins
- Uses os.walk() instead of reinventing it.

There were so many changes to make that I eventually just rewrote the entire findfiles function. I've checked that the new version returns the same strings as the old version.
History
Date User Action Args
2015-01-09 08:16:00Al.Sweigartsetrecipients: + Al.Sweigart
2015-01-09 08:16:00Al.Sweigartsetmessageid: <1420791360.73.0.110066531981.issue23205@psf.upfronthosting.co.za>
2015-01-09 08:16:00Al.Sweigartlinkissue23205 messages
2015-01-09 08:16:00Al.Sweigartcreate