def test_install_and_remove_with_deps(np_path): ethpm.install_package(np_path, "ipfs://testipfs-complex") assert np_path.joinpath("contracts/math/Math.sol").exists() assert ethpm.get_installed_packages(np_path) == ([("complex", "1.0.0")], []) ethpm.install_package(np_path, "ipfs://testipfs-math") assert ethpm.get_installed_packages(np_path) == ([("complex", "1.0.0"), ("math", "1.0.0")], []) ethpm.remove_package(np_path, "complex", True) assert np_path.joinpath("contracts/math/Math.sol").exists() assert not np_path.joinpath("contracts/complex/Complex.sol").exists() assert ethpm.get_installed_packages(np_path) == ([("math", "1.0.0")], [])
def _unlink(project_path, name): if ethpm.remove_package(project_path, name, False): notify( "SUCCESS", f'The "{color("bright magenta")}{name}{color}" package was unlinked.' ) return notify( "ERROR", f'"{color("bright magenta")}{name}{color}" is not installed in this project.' )
def test_remove_no_delete_re_add(np_path): ethpm.install_package(np_path, "ipfs://testipfs-math") ethpm.remove_package(np_path, "math", False) ethpm.install_package(np_path, "ipfs://testipfs-math") assert np_path.joinpath("contracts/math/Math.sol").exists() assert ethpm.get_installed_packages(np_path) == ([("math", "1.0.0")], [])
def test_remove_package(np_path): ethpm.install_package(np_path, "ipfs://testipfs-math") ethpm.remove_package(np_path, "math", True) assert ethpm.get_installed_packages(np_path) == ([], []) assert not np_path.joinpath("contracts/math/Math.sol").exists()
def test_remove_no_delete(tp_path): ethpm.install_package(tp_path, "ipfs://testipfs-math") ethpm.remove_package(tp_path, "math", False) assert ethpm.get_installed_packages(tp_path) == ([], []) assert tp_path.joinpath("contracts/math/Math.sol").exists()