mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 12:06:53 +00:00
Remove dependency on plumbum
This commit is contained in:
parent
c9b6161fab
commit
713fab4bc7
12 changed files with 99 additions and 55 deletions
17
tests/util_test.py
Normal file
17
tests/util_test.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
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'
|
||||
Loading…
Add table
Add a link
Reference in a new issue