summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-02-25 09:06:45 -0600
committerIan Cordasco <graffatcolmingov@gmail.com>2016-02-25 09:06:50 -0600
commita4e984dbd258faf125a115bae1561db3fbd8e934 (patch)
tree29787fa01439fc1361d7d5bdca9edc5be1a7980c /tests
parentcd18b9f175a3a73b03f58d4db7fd789c48c671bb (diff)
downloadflake8-a4e984dbd258faf125a115bae1561db3fbd8e934.tar.gz
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
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
index 615f327..28b8e02 100644
--- a/tests/unit/test_utils.py
+++ b/tests/unit/test_utils.py
@@ -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/'))