示例#1
0
文件: test_gitr.py 项目: tbarron/gitr
def test_find_repo_root_not(tmpdir):
    """
    Not in a repo
    """
    with tbx.chdir(tmpdir.strpath):
        with pytest.raises(git.InvalidGitRepositoryError):
            gitr.find_repo_root()
示例#2
0
文件: test_gitr.py 项目: tbarron/gitr
def test_find_repo_root_not(tmpdir):
    """
    Not in a repo
    """
    with tbx.chdir(tmpdir.strpath):
        with pytest.raises(git.InvalidGitRepositoryError):
            gitr.find_repo_root()
示例#3
0
文件: test_gitr.py 项目: tbarron/gitr
def test_find_repo_root_deep(repo_setup, tmpdir):
    """
    repo is several levels up
    """
    sub = tmpdir.join('a/b/c').ensure(dir=True)
    with tbx.chdir(sub.strpath):
        assert tmpdir.strpath == gitr.find_repo_root()
示例#4
0
文件: test_gitr.py 项目: tbarron/gitr
def test_find_repo_root_deep(repo_setup, tmpdir):
    """
    repo is several levels up
    """
    sub = tmpdir.join('a/b/c').ensure(dir=True)
    with tbx.chdir(sub.strpath):
        assert tmpdir.strpath == gitr.find_repo_root()
示例#5
0
文件: test_gitr.py 项目: tbarron/gitr
def test_find_repo_root_shallow(repo_setup, tmpdir):
    """
    Current dir is the repo
    """
    with tbx.chdir(tmpdir.strpath):
        assert tmpdir.strpath == gitr.find_repo_root()
示例#6
0
文件: test_gitr.py 项目: tbarron/gitr
def test_find_repo_root_shallow(repo_setup, tmpdir):
    """
    Current dir is the repo
    """
    with tbx.chdir(tmpdir.strpath):
        assert tmpdir.strpath == gitr.find_repo_root()