mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-04 11:16:53 +00:00
Merge pull request #205 from dlgallagher/fix_requirements_txt_fixer_on_empty_requirements_files
Fix NoneTypeError when requirements file is empty
This commit is contained in:
commit
d419bef35c
2 changed files with 13 additions and 8 deletions
|
|
@ -5,6 +5,8 @@ from pre_commit_hooks.requirements_txt_fixer import Requirement
|
|||
|
||||
# Input, expected return value, expected output
|
||||
TESTS = (
|
||||
(b'', 0, b''),
|
||||
(b'\n', 0, b'\n'),
|
||||
(b'foo\nbar\n', 1, b'bar\nfoo\n'),
|
||||
(b'bar\nfoo\n', 0, b'bar\nfoo\n'),
|
||||
(b'#comment1\nfoo\n#comment2\nbar\n', 1, b'#comment2\nbar\n#comment1\nfoo\n'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue