Add from_geojson test that validates current behavior - refs #2390

This commit is contained in:
Dane Springmeyer 2014-08-25 12:04:35 -07:00
parent 225810e3ee
commit 1011e9d3c7

View file

@ -95,5 +95,25 @@ def test_feature_expression_evaluation_attr_with_spaces():
eq_(str(expr),"([name with space]='a')")
eq_(expr.evaluate(f),True)
# https://github.com/mapnik/mapnik/issues/2390
def test_feature_from_geojson():
ctx = mapnik.Context()
inline_string = """
{
"geometry" : {
"coordinates" : [ 0,0 ]
"type" : "Point"
},
"type" : "Feature",
"properties" : {
"this":"that"
"known":"nope because missing comma"
}
}
"""
feat = mapnik.Feature.from_geojson(inline_string,ctx)
eq_(feat['this'],u'that')
eq_(feat['known'],None)
if __name__ == "__main__":
exit(run_all(eval(x) for x in dir() if x.startswith("test_")))