test_geth_installation.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:py-geth 作者: ethereum 项目源码 文件源码
def test_geth_installation_as_function_call(monkeypatch, tmpdir, platform, version):
    if get_platform() != platform:
        pytest.skip("Wront platform for install script")

    base_install_path = str(tmpdir.mkdir("temporary-dir"))
    monkeypatch.setenv('GETH_BASE_INSTALL_PATH', base_install_path)

    # sanity check that it's not already installed.
    executable_path = get_executable_path(version)
    assert not os.path.exists(executable_path)

    install_geth(identifier=version, platform=platform)

    assert os.path.exists(executable_path)
    monkeypatch.setenv('GETH_BINARY', executable_path)

    actual_version = get_geth_version()
    expected_version = semantic_version.Spec(version.lstrip('v'))

    assert actual_version in expected_version
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号