示例#1
0
def test_uninstall_packages(uninstall, keep, config, test_assets_dir,
                            owned_pkg, wallet_pkg):
    install_package(owned_pkg, config)
    install_package(wallet_pkg, config)
    uninstall_package(uninstall, config)

    assert (config.ethpm_dir / keep).is_dir()
    assert not (config.ethpm_dir / uninstall).is_dir()
    assert check_dir_trees_equal(
        config.ethpm_dir,
        (test_assets_dir / keep / "ipfs_uri" / ETHPM_PACKAGES_DIR))
示例#2
0
def test_uninstall_package_warns_if_package_doesnt_exist(config):
    with pytest.raises(InstallError, match="No package with the name invalid"):
        uninstall_package("invalid", config)
示例#3
0
def uninstall_action(args: argparse.Namespace) -> None:
    validate_uninstall_cli_args(args)
    config = Config(args)
    uninstall_package(args.package, config)
    cli_logger.info("%s uninstalled from %s", args.package, config.ethpm_dir)