Ejemplo n.º 1
0
def test_builder_with_pin_source(owned_package, dummy_ipfs_backend):
    root, expected_manifest, compiler_output = owned_package
    ipfs_backend = get_ipfs_backend()

    manifest = build(
        {},
        package_name("owned"),
        manifest_version("2"),
        version("1.0.0"),
        authors("Piper Merriam <*****@*****.**>"),
        description(
            "Reusable contracts which implement a privileged 'owner' model for authorization."
        ),
        keywords("authorization"),
        license("MIT"),
        links(documentation=
              "ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW"),
        pin_source("Owned", compiler_output, ipfs_backend, root),
        validate(),
    )

    assert manifest == expected_manifest
Ejemplo n.º 2
0
        )


@pytest.mark.parametrize(
    "fn,value",
    (
        (authors("some", "guy"), {
            "authors": ["some", "guy"]
        }),
        (license("MIT"), {
            "license": "MIT"
        }),
        (description("This is a package."), {
            "description": "This is a package."
        }),
        (keywords("awesome", "package"), {
            "keywords": ["awesome", "package"]
        }),
        (
            links(documentation="ipfs..", website="www"),
            {
                "links": {
                    "documentation": "ipfs..",
                    "website": "www"
                }
            },
        ),
    ),
)
def test_builder_with_simple_meta_fields(fn, value):
    manifest = build(BASE_MANIFEST, fn, validate())
Ejemplo n.º 3
0
def gen_keywords() -> Optional[Callable[..., Manifest]]:
    flag = parse_bool_flag("Would you like to add keywords to your package?")
    if flag:
        keywords = input("Enter a keyword, or multiple keywords separated by commas: ")
        return b.keywords(*[keyword.strip() for keyword in keywords.split(",")])
    return None