mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
define more branch protected
This commit is contained in:
parent
5bf6c09bfa
commit
0e20aa09e2
2 changed files with 16 additions and 10 deletions
|
|
@ -9,24 +9,24 @@ from pre_commit_hooks.util import cmd_output
|
|||
def test_other_branch(temp_git_dir):
|
||||
with temp_git_dir.as_cwd():
|
||||
cmd_output('git', 'checkout', '-b', 'anotherbranch')
|
||||
assert is_on_branch('master') is False
|
||||
assert is_on_branch(('master', )) is False
|
||||
|
||||
|
||||
def test_multi_branch(temp_git_dir):
|
||||
with temp_git_dir.as_cwd():
|
||||
cmd_output('git', 'checkout', '-b', 'another/branch')
|
||||
assert is_on_branch('master') is False
|
||||
assert is_on_branch(('master', )) is False
|
||||
|
||||
|
||||
def test_multi_branch_fail(temp_git_dir):
|
||||
with temp_git_dir.as_cwd():
|
||||
cmd_output('git', 'checkout', '-b', 'another/branch')
|
||||
assert is_on_branch('another/branch') is True
|
||||
assert is_on_branch(('another/branch', )) is True
|
||||
|
||||
|
||||
def test_master_branch(temp_git_dir):
|
||||
with temp_git_dir.as_cwd():
|
||||
assert is_on_branch('master') is True
|
||||
assert is_on_branch(('master', )) is True
|
||||
|
||||
|
||||
def test_main_b_call(temp_git_dir):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue