示例#1
0
def test_create(tp_path, mocker):
    mocker.spy(ethpm, "create_manifest")
    with tp_path.joinpath("ethpm-config.yaml").open("w") as fp:
        json.dump(ETHPM_CONFIG, fp)
    cli_ethpm._create(tp_path)
    assert ethpm.create_manifest.call_count == 1
    assert tp_path.joinpath("manifest.json").exists()
示例#2
0
def test_exceptions(tp_path, monkeypatch):
    monkeypatch.setattr(
        "brownie.project.ethpm.create_manifest",
        lambda project_path, package_config: raise_exception(
            Exception("foobar")),
    )

    with tp_path.joinpath("ethpm-config.yaml").open("w") as fp:
        json.dump(ETHPM_CONFIG, fp)
    cli_ethpm._create(tp_path)

    assert not tp_path.joinpath("manifest.json").exists()