def test_ethpm_already_installed(): path = _get_data_folder().joinpath("packages/zeppelin.snakecharmers.eth") path.mkdir() path.joinpath("[email protected]").mkdir() with pytest.raises(FileExistsError): install_package("ethpm://zeppelin.snakecharmers.eth:1/[email protected]")
def test_github_already_installed(): path = _get_data_folder().joinpath("packages/brownie-mix") path.mkdir() path.joinpath("[email protected]").mkdir() with pytest.raises(FileExistsError): install_package("brownie-mix/[email protected]")
def test_dependency_already_installed(dependentproject): install_package("brownie-mix/[email protected]") dependentproject.load()
def test_valid_repo_not_a_project(): with pytest.raises(InvalidPackage): install_package("iamdefinitelyahuman/[email protected]") assert not _get_data_folder().joinpath("packages/iamdefinitelyahuman/[email protected]").exists()
def test_bad_project_id_repo_org(): with pytest.raises(ValueError): install_package("[email protected]")
def test_bad_project_id_version(): with pytest.raises(ValueError): install_package("brownie-mix/token-mix")
def test_unknown_version(): with pytest.raises(ValueError): install_package("brownie-mix/[email protected]")
def test_install_from_ethpm(ipfs_mock): install_package("ethpm://zeppelin.snakecharmers.eth:1/[email protected]")
def test_install_from_github(): install_package("brownie-mix/[email protected]")
def test_wont_compile(): # can't compile due to a NamespaceCollision, should still install install_package("makerdao/[email protected]")
def test_import_from_package(): install_package("brownie-mix/[email protected]") compile_source(code)
def test_pm_fixture(plugintester): install_package("brownie-mix/[email protected]") result = plugintester.runpytest() result.assert_outcomes(passed=1)
def test_popular_packages(package_test, package_id): install_package(package_id)