Add ability to pass filenames as arguments.

This commit is contained in:
Anthony Sottile 2014-09-16 17:27:40 -07:00
parent cfd86d5faa
commit d8d7893cf7
3 changed files with 23 additions and 6 deletions

View file

@ -43,13 +43,17 @@ def get_write_mock_output(write_mock):
def _get_opts(
all_files=False,
files=(),
color=False,
verbose=False,
hook=None,
no_stash=False,
):
# These are mutually exclusive
assert not (all_files and files)
return auto_namedtuple(
all_files=all_files,
files=files,
color=color,
verbose=verbose,
hook=hook,
@ -100,6 +104,12 @@ def test_run_all_hooks_failing(
0,
True,
),
(
{'files': ('foo.py',), 'verbose': True},
('foo.py'),
0,
True,
),
({}, ('Bash hook', '(no files to check)', 'Skipped'), 0, False),
)
)