File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed
Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -392,23 +392,14 @@ def add_mock_vector_layer_download_responses(layer_id, num_features):
392392 "download_url" : "http://layer.geojson.example.com" ,
393393 }
394394 add_mock_operations_responses ("success" , results = results )
395- features = []
396- for i in range (num_features ):
397- url = results ["download_url" ]
398- features .append (
399- {
400- "type" : "Feature" ,
401- "geometry" : make_geojson_multipolygon (i + 1 ),
402- "properties" : {},
403- }
404- )
405- fc = {"type" : "FeatureCollection" , "features" : features }
395+ url = results ["download_url" ]
396+ mp = make_geojson_multipolygon (2 )
406397 responses .add (
407398 responses .GET ,
408399 url ,
409- body = json .dumps (fc ),
400+ body = json .dumps (mp ),
410401 )
411- return fc
402+ return mp
412403
413404
414405def make_geojson_multipolygon (npolygons = 1 ):
@@ -1008,11 +999,11 @@ def test_download_vector_layer_to_file(monkeypatch):
1008999 client = _client (monkeypatch )
10091000 with tempfile .NamedTemporaryFile () as fp :
10101001 client .download_vector_layer_to_file ("foobar" , fp .name )
1011- fc = json .load (fp )
1012- assert fc == expected_content and len (fc ["features" ]) == 2
1002+ mp = json .load (fp )
10131003 assert (
1014- fc ["type" ] == "FeatureCollection" and fc [ "features" ][ 0 ][ "type" ] == "Feature "
1004+ mp ["type" ] == "MultiPolygon "
10151005 )
1006+ assert mp == expected_content and len (mp ["coordinates" ]) == 2
10161007 assert len (responses .calls ) == 3 # POST /download, GET /operations, GET url
10171008
10181009
You can’t perform that action at this time.
0 commit comments