コード例 #1
0
ファイル: test_init.py プロジェクト: dmerejkowsky/tsrc
def test_clone_destination_is_a_file(tsrc_cli: CLI, git_server: GitServer,
                                     workspace_path: Path) -> None:
    manifest_url = git_server.manifest_url
    git_server.add_repo("foo")

    with (workspace_path / "foo").open("w") as f:
        f.write("this is a file")

    tsrc_cli.run_and_fail_with(ClonerError, "init", manifest_url)
コード例 #2
0
ファイル: test_sync.py プロジェクト: xzr/tsrc
    def test_non_existing_group(
        tsrc_cli: CLI, git_server: GitServer, workspace_path: Path
    ) -> None:
        """Scenario:
        * Create a manifest containing :
          * a group named 'group1'  containing the repo 'foo'
          * a group named 'group2'  containing the repo 'bar'
        * Initialize a workspace from this manifest using the 'group1' and 'group2' groups
        * Check that `tsrc sync --group no-such-group` fails
        """
        git_server.add_group("group1", ["foo"])
        git_server.add_group("group2", ["bar"])

        tsrc_cli.run("init", git_server.manifest_url)

        tsrc_cli.run_and_fail_with(GroupNotFound, "sync", "--group", "no-such-group")