Ejemplo n.º 1
0
def test_save(tmp_path: Path) -> None:
    """ Check that workspace config can be written
    and read.

    Note: the writing is done by `tsrc init`, all other
    commands simply read the file.
    """
    config = WorkspaceConfig(
        manifest_url="https://gitlab.example",
        manifest_branch="stable",
        shallow_clones=True,
        repo_groups=["default", "a-team"],
        clone_all_repos=False,
    )
    persistent_path = tmp_path / "config.yml"
    config.save_to_file(persistent_path)
    actual = WorkspaceConfig.from_file(persistent_path)
    assert actual == config
Ejemplo n.º 2
0
def change_workspace_manifest_branch(workspace_path: Path,
                                     branch: str) -> None:
    cfg_path = workspace_path / ".tsrc/config.yml"
    workspace_config = WorkspaceConfig.from_file(cfg_path)
    workspace_config.manifest_branch = branch
    workspace_config.save_to_file(cfg_path)