mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-04 19:26:52 +00:00
Fix NoneTypeError when requirements file is empty
This commit is contained in:
parent
78818b90cd
commit
7ccfa05f2f
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