Add and fix documentation

- Add more documentation around utils functions
- Fix documentation about default formatting plugins
- Add extra documentation of filenames_from predicate parameter
- Add test for the default parameter of flake8.utils.fnmatch
This commit is contained in:
Ian Cordasco 2016-02-25 09:06:45 -06:00
parent cd18b9f175
commit a4e984dbd2
5 changed files with 67 additions and 5 deletions

View file

@ -64,6 +64,12 @@ def test_fnmatch(filename, patterns, expected):
assert utils.fnmatch(filename, patterns) is expected
def test_fnmatch_returns_the_default_with_empty_default():
"""The default parameter should be returned when no patterns are given."""
sentinel = object()
assert utils.fnmatch('file.py', [], default=sentinel) is sentinel
def test_filenames_from_a_directory():
"""Verify that filenames_from walks a directory."""
filenames = list(utils.filenames_from('flake8/'))