Example #1
0
def test_builder_with_multiple_build_dependencies():
    expected_build_deps = {
        "escrow": "ipfs://QmPDwMHk8e1aMEZg3iKsUiPSkhHkywpGB3KHKM52RtGrkv",
        "package": "ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW",
    }
    expected = assoc_in(BASE_MANIFEST, ["build_dependencies"],
                        expected_build_deps)
    actual = build(
        BASE_MANIFEST,
        build_dependency(
            "package",
            "ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW"),
        build_dependency(
            "escrow", "ipfs://QmPDwMHk8e1aMEZg3iKsUiPSkhHkywpGB3KHKM52RtGrkv"),
    )
    assert actual == expected
Example #2
0
def test_builder_with_invalid_uri():
    with pytest.raises(ValidationError,
                       match="is not a supported content-addressed URI"):
        build(
            {},
            package_name("package"),
            version("1.0.0"),
            manifest_version("2"),
            build_dependency("package", "www.google.com"),
        )
Example #3
0
def test_builder_with_single_build_dependency():
    expected_build_dep = {
        "package": "ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW"
    }
    expected = assoc_in(BASE_MANIFEST, ["build_dependencies"],
                        expected_build_dep)
    actual = build(
        BASE_MANIFEST,
        build_dependency(
            "package",
            "ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW"),
    )
    assert actual == expected