1
0
Fork 0

Adding upstream version 2.9.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:22:51 +01:00
parent e8d3ba475e
commit 5f54aad01b
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
32 changed files with 252 additions and 75 deletions

View file

@ -2,24 +2,9 @@ import pytest
import pre_commit.constants as C
from pre_commit.clientlib import InvalidConfigError
from pre_commit.commands.migrate_config import _indent
from pre_commit.commands.migrate_config import migrate_config
@pytest.mark.parametrize(
('s', 'expected'),
(
('', ''),
('a', ' a'),
('foo\nbar', ' foo\n bar'),
('foo\n\nbar\n', ' foo\n\n bar\n'),
('\n\n\n', '\n\n\n'),
),
)
def test_indent(s, expected):
assert _indent(s) == expected
def test_migrate_config_normal_format(tmpdir, capsys):
cfg = tmpdir.join(C.CONFIG_FILE)
cfg.write(