mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Simplify has_unmerged_paths
This commit is contained in:
parent
846ddeed67
commit
2e4cde9cb0
2 changed files with 5 additions and 15 deletions
|
|
@ -277,14 +277,10 @@ def test_no_stash(repo_with_passing_hook, no_stash, all_files, expect_stash):
|
|||
assert warning_msg not in printed
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('mode', 'expected'),
|
||||
[(status, True) for status in commands.CONFLICTING_GIT_STATUSES] +
|
||||
[(' A', False), (' D', False), (' M', False)]
|
||||
)
|
||||
def test_has_unmerged_paths(mode, expected):
|
||||
@pytest.mark.parametrize(('output', 'expected'), (('some', True), ('', False)))
|
||||
def test_has_unmerged_paths(output, expected):
|
||||
mock_runner = mock.Mock()
|
||||
mock_runner.cmd_runner.run.return_value = (1, mode + ' foo', '')
|
||||
mock_runner.cmd_runner.run.return_value = (1, output, '')
|
||||
assert commands._has_unmerged_paths(mock_runner) is expected
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue