Message233727
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. |
|
Date |
User |
Action |
Args |
2015-01-09 08:16:00 | Al.Sweigart | set | recipients:
+ Al.Sweigart |
2015-01-09 08:16:00 | Al.Sweigart | set | messageid: <1420791360.73.0.110066531981.issue23205@psf.upfronthosting.co.za> |
2015-01-09 08:16:00 | Al.Sweigart | link | issue23205 messages |
2015-01-09 08:16:00 | Al.Sweigart | create | |
|