summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2019-07-28 10:39:27 -0400
committerEric N. Vander Weele <ericvw@gmail.com>2019-07-28 10:43:06 -0400
commit1ba56b9056fd60dbb0f991fe5a4ac0bb6ad85cb9 (patch)
treeec59e09c49d61a785ec2b9b2ccf67c0d3395e98a /tests
parenta0cd55fd6d2697f4823d1de24c9dda5858b27610 (diff)
downloadflake8-1ba56b9056fd60dbb0f991fe5a4ac0bb6ad85cb9.tar.gz
utils: Change `normalize_paths()` contract
The `normalize_paths()` utility was doing too much — parsing unstructured configuration path data and dispatching the scrubbed paths to be normalized. Towards moving the parsing of unstructured configuration path data closer towards were configuration occurs, have the utility accept only structured input for normalizing paths.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_utils.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
index b4bd1a1..9fd03b2 100644
--- a/tests/unit/test_utils.py
+++ b/tests/unit/test_utils.py
@@ -127,14 +127,13 @@ def test_normalize_path(value, expected):
@pytest.mark.parametrize("value,expected", [
- ("flake8,pep8,pyflakes,mccabe", ["flake8", "pep8", "pyflakes", "mccabe"]),
- ("flake8,\n\tpep8,\n pyflakes,\n\n mccabe",
+ (["flake8", "pep8", "pyflakes", "mccabe"],
["flake8", "pep8", "pyflakes", "mccabe"]),
- ("../flake8,../pep8,../pyflakes,../mccabe",
+ (["../flake8", "../pep8", "../pyflakes", "../mccabe"],
[os.path.abspath("../" + p) for p in RELATIVE_PATHS]),
])
def test_normalize_paths(value, expected):
- """Verify we normalize comma-separated paths provided to the tool."""
+ """Verify we normalizes a sequence of paths provided to the tool."""
assert utils.normalize_paths(value) == expected