def test_bad(): from copy import deepcopy bad = deepcopy(points) bad[0]['geometry']['type'] = "Foo" with pytest.raises(ValueError): profile(bad, "elev") bad = deepcopy(points) bad[0]['type'] = "Foo" with pytest.raises(ValueError): profile(bad, "elev")
def test_profile(): res = profile(points, "elev") assert [int(x) for x in res[0]] == [0, 44, 137] # starting point is distance of zero assert res[1] == [77.5, 88.5, 99.5] # Ys