Esempio n. 1
0
def checked_out_repo(cloneable_with_commits):
    parser = repo_parser.RepoParser(cloneable_with_commits.path)
    with parser.repo_checked_out():
        yield auto_namedtuple(
            repo_parser=parser,
            cloneable_with_commits=cloneable_with_commits,
        )
Esempio n. 2
0
def test_repo_checked_out(cloneable):
    parser = repo_parser.RepoParser(cloneable)
    assert parser.tempdir is None

    with parser.repo_checked_out():
        assert parser.tempdir is not None

        tempdir_path = parser.tempdir
        assert os.path.exists(tempdir_path)
        assert os.path.exists(os.path.join(tempdir_path, '.git'))

    assert parser.tempdir is None
    assert not os.path.exists(tempdir_path)