Пример #1
0
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
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
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
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
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
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()