Fix broken local golang repos

This commit is contained in:
Anthony Sottile 2018-01-09 09:42:44 -08:00
parent a5f3cefb64
commit 40690064f7
2 changed files with 33 additions and 0 deletions

View file

@ -541,6 +541,24 @@ def test_additional_golang_dependencies_installed(
assert 'hello' in binaries
def test_local_golang_additional_dependencies(store):
config = {
'repo': 'local',
'hooks': [{
'id': 'hello',
'name': 'hello',
'entry': 'hello',
'language': 'golang',
'additional_dependencies': ['github.com/golang/example/hello'],
}],
}
repo = Repository.create(config, store)
(_, hook), = repo.hooks
ret = repo.run_hook(hook, ('filename',))
assert ret[0] == 0
assert _norm_out(ret[1]) == b"Hello, Go examples!\n"
def test_reinstall(tempdir_factory, store, log_info_mock):
path = make_repo(tempdir_factory, 'python_hooks_repo')
config = make_config_from_repo(path)