コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
def test_master_branch(temp_git_dir):
    with temp_git_dir.as_cwd():
        assert is_on_branch('master') is True
コード例 #4
0
def test_master_branch(temp_git_dir):
    with temp_git_dir.as_cwd():
        assert is_on_branch({'master'}) is True
コード例 #5
0
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
コード例 #6
0
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
コード例 #7
0
def test_branch_pattern_fail(temp_git_dir):
    with temp_git_dir.as_cwd():
        cmd_output('git', 'checkout', '-b', 'another/branch')
        assert is_on_branch(set(), {'another/.*'}) is True
コード例 #8
0
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