File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import unicode_literals
22
3+ import io
34import mock
45import os
56import os .path
@@ -205,7 +206,22 @@ def test_hook_id_not_in_non_verbose_output(
205206
206207
207208def test_hook_id_in_verbose_output (
208- repo_with_passing_hook , mock_out_store_directory
209+ repo_with_passing_hook , mock_out_store_directory ,
209210):
210211 ret , printed = _do_run (repo_with_passing_hook , _get_opts (verbose = True ))
211212 assert '[bash_hook] Bash hook' in printed
213+
214+
215+ def test_multiple_hooks_same_id (
216+ repo_with_passing_hook , mock_out_store_directory ,
217+ ):
218+ with local .cwd (repo_with_passing_hook ):
219+ # Add bash hook on there again
220+ with io .open ('.pre-commit-config.yaml' , 'a+' ) as config_file :
221+ config_file .write (' - id: bash_hook\n ' )
222+ local ['git' ]('add' , '.pre-commit-config.yaml' )
223+ stage_a_file ()
224+
225+ ret , output = _do_run (repo_with_passing_hook , _get_opts ())
226+ assert ret == 0
227+ assert output .count ('Bash hook' ) == 2
You can’t perform that action at this time.
0 commit comments