예제 #1
0
def test_repofactory_timeout():
    with tempfile.TemporaryDirectory() as source_root:
        repo_name = "foo"
        repo_path = os.path.join(source_root, repo_name)
        Repo.init(repo_path)
        timeout = 3

        project_name = "foo"  # does not matter for this test
        repo = get_repository(repo_path, "git", project_name, None, None, None,
                              timeout)
        assert repo is not None
        assert isinstance(repo, GitRepository)
        assert repo.timeout == timeout
예제 #2
0
 def mock_get_repos(*args, **kwargs):
     return [get_repository(cloned_repo_path,
                            "git", project_name,
                            None, None, None, None)]