Start fleshing out flake8.utils

Add parse_comma_separated_list, normalize_path, and normalize_paths and
add logic in OptionManager.parse_args to use the right normalize_path*
function based on comma_separated_list value of the option.
This commit is contained in:
Ian Cordasco 2016-01-09 15:58:26 -06:00
parent ad0200e792
commit a4042d6d69
3 changed files with 81 additions and 8 deletions

14
tests/unit/test_utils.py Normal file
View file

@ -0,0 +1,14 @@
"""Tests for flake8's utils module."""
import pytest
from flake8 import utils
@pytest.mark.parametrize("value,expected", [
("E123,\n\tW234,\n E206", ["E123", "W234", "E206"]),
("E123,W234,E206", ["E123", "W234", "E206"]),
(["E123", "W234", "E206"], ["E123", "W234", "E206"]),
(["E123", "\n\tW234", "\n E206"], ["E123", "W234", "E206"]),
])
def test_parse_comma_separated_list(value, expected):
assert utils.parse_comma_separated_list(value) == expected