MCPcopy Create free account
hub / github.com/python-visualization/folium / test_choropleth_get_by_key

Function test_choropleth_get_by_key

tests/test_features.py:326–347  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

324
325
326def test_choropleth_get_by_key():
327 geojson_data = {
328 "id": "0",
329 "type": "Feature",
330 "properties": {"idx": 0, "value": 78.0},
331 "geometry": {
332 "type": "Polygon",
333 "coordinates": [
334 [
335 [1, 2],
336 [3, 4],
337 ]
338 ],
339 },
340 }
341
342 # Test with string path in key_on
343 assert Choropleth._get_by_key(geojson_data, "properties.idx") == 0
344 assert Choropleth._get_by_key(geojson_data, "properties.value") == 78.0
345
346 # Test with combined string path and numerical index in key_on
347 assert Choropleth._get_by_key(geojson_data, "geometry.coordinates.0.0") == [1, 2]

Callers

nothing calls this directly

Calls 1

_get_by_keyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…