()
| 324 | |
| 325 | |
| 326 | def 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] |
nothing calls this directly
no test coverage detected
searching dependent graphs…