Esempio n. 1
0
def test_resource_publish() -> None:
    """Test datapackage resource publish."""

    dp = deetly.metadata(metadata)
    dp.df(df, "Iris", "Iris dataset")
    dp.publish()
    assert len(dp.resources) == 1
Esempio n. 2
0
def test_add_link() -> None:
    """Test datapackage add link."""

    dp = deetly.metadata(metadata)
    dp.link("https://storage.googleapis.com/deetly/data/test.pdf", "Test pdf")
    assert (len(dp.resources) == 1 and dp.resources[0]["format"] == "pdf"
            and dp.resources[0]["mediatype"] == "application/pdf")
Esempio n. 3
0
def test_toJSON() -> None:
    """Test datapackage toJSON."""

    dp = deetly.metadata(metadata)
    res = dp.toJSON()
    assert res.get("name") == metadata.get("name")
Esempio n. 4
0
def test_metadata_publish() -> None:
    """Test datapackage publish."""
    dp = deetly.metadata(metadata)
    dp.publish()
    id = deetly.utils.get_id_from_metadata(metadata)
    assert dp.id == id
Esempio n. 5
0
def test_metadata_init() -> None:
    """Test metadata init."""
    dp = deetly.metadata(metadata)
    assert dp.title == metadata.get("name")