mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2025-08-26 18:10:18 +08:00
15 lines
318 B
Python
15 lines
318 B
Python
import pytest
|
|
|
|
from pre_commit_hooks.util import CalledProcessError
|
|
from pre_commit_hooks.util import cmd_output
|
|
|
|
|
|
def test_raises_on_error():
|
|
with pytest.raises(CalledProcessError):
|
|
cmd_output('sh', '-c', 'exit 1')
|
|
|
|
|
|
def test_output():
|
|
ret = cmd_output('sh', '-c', 'echo hi')
|
|
assert ret == 'hi\n'
|