def test_parse_single_feature_geo(features): feature = features['features'][0] o = GeoDict(feature) expected = {'type': 'FeatureCollection', 'features': [feature]} contents = geojsonio.make_geojson(o) assert contents == json.dumps(expected)
def test_parse_single_feature_geo(features): feature = features['features'][0] o = GeoDict(feature) expected = { 'type': 'FeatureCollection', 'features': [feature] } contents = geojsonio.make_geojson(o) assert contents == json.dumps(expected)
def test_parse_fail_list_non_feature(features): os = [GeoDict(features['features'][0]), 5] with pytest.raises(ValueError): geojsonio.make_geojson(os)
def test_parse_fail_non_feature(): with pytest.raises(ValueError): geojsonio.make_geojson(5)
def test_parse_list_features_geo(features): os = [GeoDict(f) for f in features['features']] contents = geojsonio.make_geojson(os) dict_contents = json.loads(contents) assert features == dict_contents
def test_parse_string(features): contents = json.dumps(features) assert geojsonio.make_geojson(contents) == contents