Test fit_bounds.
(self)
| 389 | m._parent.render() |
| 390 | |
| 391 | def test_fit_bounds(self): |
| 392 | """Test fit_bounds.""" |
| 393 | bounds = ((52.193636, -2.221575), (52.636878, -1.139759)) |
| 394 | self.m.fit_bounds(bounds) |
| 395 | fitbounds = [ |
| 396 | val |
| 397 | for key, val in self.m._children.items() |
| 398 | if isinstance(val, folium.FitBounds) |
| 399 | ][0] |
| 400 | out = self.m._parent.render() |
| 401 | |
| 402 | fit_bounds_rendered = self.fit_bounds_template.render( |
| 403 | { |
| 404 | "bounds": json.dumps(bounds), |
| 405 | "this": fitbounds, |
| 406 | "fit_bounds_options": {}, |
| 407 | } |
| 408 | ) |
| 409 | |
| 410 | assert "".join(fit_bounds_rendered.split()) in "".join(out.split()) |
| 411 | |
| 412 | def test_fit_bounds_2(self): |
| 413 | bounds = ((52.193636, -2.221575), (52.636878, -1.139759)) |
nothing calls this directly
no test coverage detected