def test_data_url(features): feature = features['features'][0] header = "http://geojson.io/#data=data:application/json," length = len(header) result = geojsonio.data_url(json.dumps(feature)) payload = json.loads(urllib.parse.unquote(result[length:])) assert result[:length] == header assert payload == feature
def test_factory_data(features): contents = json.dumps(features) size = len(contents) url = geojsonio.make_url(contents, size_for_gist=size+1) assert url == geojsonio.data_url(contents)
def test_factory_data(features): contents = json.dumps(features) size = len(contents) url = geojsonio.make_url(contents, size_for_gist=size + 1) assert url == geojsonio.data_url(contents)