mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-10 05:14:18 +00:00
Make tests pass
This commit is contained in:
parent
b941d0e6df
commit
05d9c8c805
2 changed files with 1 additions and 19 deletions
|
|
@ -110,7 +110,7 @@
|
||||||
description: Sort the lines in specified files (defaults to alphabetical). You must provide list of target files as input in your .pre-commit-config.yaml file.
|
description: Sort the lines in specified files (defaults to alphabetical). You must provide list of target files as input in your .pre-commit-config.yaml file.
|
||||||
entry: file-contents-sorter
|
entry: file-contents-sorter
|
||||||
language: python
|
language: python
|
||||||
files: ''
|
files: '^$'
|
||||||
- id: fix-encoding-pragma
|
- id: fix-encoding-pragma
|
||||||
name: Fix python encoding pragma
|
name: Fix python encoding pragma
|
||||||
language: python
|
language: python
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import pytest
|
||||||
|
|
||||||
from pre_commit_hooks.file_contents_sorter import FAIL
|
from pre_commit_hooks.file_contents_sorter import FAIL
|
||||||
from pre_commit_hooks.file_contents_sorter import main
|
from pre_commit_hooks.file_contents_sorter import main
|
||||||
from pre_commit_hooks.file_contents_sorter import parse_commandline_input
|
|
||||||
from pre_commit_hooks.file_contents_sorter import PASS
|
from pre_commit_hooks.file_contents_sorter import PASS
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -29,20 +28,3 @@ def test_integration(input_s, expected_retval, output, tmpdir):
|
||||||
|
|
||||||
assert path.read_binary() == output
|
assert path.read_binary() == output
|
||||||
assert output_retval == expected_retval
|
assert output_retval == expected_retval
|
||||||
|
|
||||||
|
|
||||||
def test_parse_commandline_input_errors_without_args():
|
|
||||||
with pytest.raises(SystemExit):
|
|
||||||
parse_commandline_input([])
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
('filename_list'),
|
|
||||||
(
|
|
||||||
['filename1'],
|
|
||||||
['filename1', 'filename2'],
|
|
||||||
)
|
|
||||||
)
|
|
||||||
def test_parse_commandline_input_success(filename_list):
|
|
||||||
args = parse_commandline_input(filename_list)
|
|
||||||
assert args.filenames == filename_list
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue