Add support for sections in requirements-fixer

This commit is contained in:
Michael Aquilina 2024-08-16 14:41:47 +01:00
parent 429455474b
commit cc5d4504d0
No known key found for this signature in database
GPG key ID: 636066730B056BD1
2 changed files with 58 additions and 28 deletions

View file

@ -107,6 +107,25 @@ from pre_commit_hooks.requirements_txt_fixer import Requirement
PASS,
b'a=2.0.0 \\\n --hash=sha256:abcd\nb==1.0.0\n',
),
(
(
b'-c external.txt\n'
b'\n'
b'Peach\n'
b'apple\n'
b'banana\n'
b'pear\n'
),
FAIL,
(
b'-c external.txt\n'
b'\n'
b'apple\n'
b'banana\n'
b'Peach\n'
b'pear\n'
),
),
),
)
def test_integration(input_s, expected_retval, output, tmpdir):