Modify a test to make sure arguments are getting passed correctly

This commit is contained in:
Anthony Sottile 2014-03-22 15:22:06 -07:00
parent afed660077
commit a1ba715b50
2 changed files with 5 additions and 3 deletions

View file

@ -67,6 +67,8 @@ setup(
local.path('__init__.py').write('') local.path('__init__.py').write('')
local.path('main.py').write(""" local.path('main.py').write("""
def func(): def func():
import sys
print repr(sys.argv[1:])
print 'Hello World' print 'Hello World'
return 0 return 0
""") """)

View file

@ -46,10 +46,10 @@ def test_install_python_repo_in_env(python_pre_commit_git_repo, config_for_pytho
def test_run_a_python_hook(config_for_python_pre_commit_git_repo): def test_run_a_python_hook(config_for_python_pre_commit_git_repo):
repo = Repository(config_for_python_pre_commit_git_repo) repo = Repository(config_for_python_pre_commit_git_repo)
repo.install() repo.install()
ret = repo.run_hook('foo', []) ret = repo.run_hook('foo', ['/dev/null'])
assert ret[0] == 0 assert ret[0] == 0
assert ret[1] == 'Hello World\n' assert ret[1] == "['/dev/null']\nHello World\n"
@pytest.mark.integration @pytest.mark.integration