fix json test and add json from string test
This commit is contained in:
parent
471288a37e
commit
767a500528
1 changed files with 9 additions and 1 deletions
|
@ -28,7 +28,15 @@ def test_total_feature_count_json():
|
||||||
lyr.datasource = mapnik2.Ogr(file='../data/json/points.json',layer_by_index=0)
|
lyr.datasource = mapnik2.Ogr(file='../data/json/points.json',layer_by_index=0)
|
||||||
features = lyr.datasource.all_features()
|
features = lyr.datasource.all_features()
|
||||||
num_feats = len(features)
|
num_feats = len(features)
|
||||||
eq_(num_feats, 3)
|
eq_(num_feats, 5)
|
||||||
|
|
||||||
|
def test_reading_json_from_string():
|
||||||
|
json = open('../data/json/points.json','r').read()
|
||||||
|
lyr = mapnik2.Layer('test')
|
||||||
|
lyr.datasource = mapnik2.Ogr(file=json,layer_by_index=0)
|
||||||
|
features = lyr.datasource.all_features()
|
||||||
|
num_feats = len(features)
|
||||||
|
eq_(num_feats, 5)
|
||||||
|
|
||||||
def test_feature_envelope():
|
def test_feature_envelope():
|
||||||
lyr = mapnik2.Layer('test')
|
lyr = mapnik2.Layer('test')
|
||||||
|
|
Loading…
Reference in a new issue