def test_validate_install_cli_args_rejects_invalid_absolute_paths( args, tmpdir): invalid_path = Path(tmpdir) / "does_not_exist" args.ethpm_dir = invalid_path with pytest.raises(InstallError): validate_install_cli_args(args)
def install_action(args: argparse.Namespace) -> None: validate_install_cli_args(args) config = Config(args) package = Package(args, config.ipfs_backend) install_package(package, config) cli_logger.info( "%s package sourced from %s installed to %s.", package.alias, args.uri, config.ethpm_dir, )
def test_validate_install_cli_args_rejects_invalid_relative_paths( args, tmpdir, monkeypatch): args.ethpm_dir = Path("./invalid") with pytest.raises(InstallError): validate_install_cli_args(args)
def test_validate_install_cli_args_validates_relative_paths_to_cwd(args): args.ethpm_dir = Path("./_ethpm_packages") assert validate_install_cli_args(args) is None
def test_validate_install_cli_args_validates_absolute_ethpm_dir_paths( args, tmpdir): ethpm_dir = Path(tmpdir) / ETHPM_PACKAGES_DIR args.ethpm_dir = ethpm_dir assert validate_install_cli_args(args) is None
def test_validate_install_cli_args_rejects_unsupported_uris(uri, args): args.uri = uri with pytest.raises(UriNotSupportedError): validate_install_cli_args(args)
def test_validate_install_cli_args_validates_supported_uris(uri, args): args.uri = uri assert validate_install_cli_args(args) is None
def test_validate_install_cli_args_rejects_invalid_aliases(alias, args): args.alias = alias with pytest.raises(ValidationError): validate_install_cli_args(args)