def test_from_dict():
    json_data = {
        "timestamp": "2013-09-16T16:55:00+00:00",
        "attribute_names": ["tilt", "azimuth"],
        "rows": [
            [13403, ["4", "180"]]
        ]
    }

    datapackage = DataPackage.from_dict(json_data)

    eq_(datapackage.attribute_names[1], "azimuth")
    eq_(datapackage.rows[0][0], 13403)
    eq_(datapackage.rows[0][1][1], "180")
Esempio n. 2
0
 def load_datapackage(stream):
     return DataPackage.from_dict(json.load(stream))