コード例 #1
0
    def test_resolves_libs_when_recursive_is_true(self, mock_git, mock_libs):
        url = "https://git.com/gitorg/repo"
        import_project(url, recursive=True)

        mock_git.clone.assert_called_once_with(
            url, pathlib.Path(url.rsplit("/", maxsplit=1)[-1]))
        mock_libs().fetch.assert_called_once()
コード例 #2
0
def import_(url: str, path: Any, skip_resolve_libs: bool) -> None:
    """Clone an Mbed project and library dependencies.

    URL: The git url of the remote project to clone.

    PATH: Destination path for the clone. If not given the destination path is set to the project name in the cwd.
    """
    click.echo(f"Cloning Mbed program '{url}'")
    if not skip_resolve_libs:
        click.echo("Resolving program library dependencies.")

    if path:
        click.echo(f"Destination path is '{path}'")
        path = pathlib.Path(path)

    dst_path = import_project(url, path, not skip_resolve_libs)
    if not skip_resolve_libs:
        libs = get_known_libs(dst_path)
        _print_dependency_table(libs)
コード例 #3
0
    def test_clones_from_remote(self, mock_git):
        url = "https://git.com/gitorg/repo"
        import_project(url, recursive=False)

        mock_git.clone.assert_called_once_with(url, pathlib.Path(url.rsplit("/", maxsplit=1)[-1]))