Ejemplo n.º 1
0
def test_init_submodules(tmpdir):
    foo_url = create_git_repo_with_submodules(tmpdir.strpath)
    worktree = create_worktree(tmpdir)
    clone_project(worktree, foo_url)
    foo = worktree.get_project("foo")
    bar_readme = os.path.join(foo.path, "bar", "README")
    assert os.path.exists(bar_readme)
Ejemplo n.º 2
0
def test_project_already_exists(tmpdir):
    bar_url = create_git_repo(tmpdir.strpath, "bar")
    baz_url = create_git_repo(tmpdir.strpath, "baz")
    worktree = create_worktree(tmpdir)
    clone_project(worktree, bar_url, src="bar")
    # pylint: disable-msg=E1101
    with pytest.raises(Exception) as e:
        qisrc.sync.clone_project(worktree, baz_url, src="bar")
    assert "already registered" in str(e.value)
Ejemplo n.º 3
0
def test_path_already_exists(tmpdir):
    bar_url = create_git_repo(tmpdir.strpath, "bar")
    worktree = create_worktree(tmpdir)
    tmpdir.join("work").mkdir("bar")
    # pylint: disable-msg=E1101
    with pytest.raises(Exception) as e:
        clone_project(worktree, bar_url)
    assert "already exists" in str(e.value)
    clone_project(worktree, bar_url, src="baz")
    assert worktree.git_projects[0].src == "baz"
Ejemplo n.º 4
0
def test_simple(tmpdir):
    bar_url = create_git_repo(tmpdir.strpath, "bar")
    worktree = create_worktree(tmpdir)
    clone_project(worktree, bar_url)
    assert len(worktree.git_projects) == 1
    assert worktree.git_projects[0].src == "bar"