MCPcopy
hub / github.com/python-visualization/folium / test_fit_bounds_2

Method test_fit_bounds_2

tests/test_folium.py:412–439  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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))
414 self.m.fit_bounds(bounds, max_zoom=15, padding=(3, 3))
415 fitbounds = [
416 val
417 for key, val in self.m._children.items()
418 if isinstance(val, folium.FitBounds)
419 ][0]
420 out = self.m._parent.render()
421
422 fit_bounds_rendered = self.fit_bounds_template.render(
423 {
424 "bounds": json.dumps(bounds),
425 "fit_bounds_options": json.dumps(
426 {
427 "maxZoom": 15,
428 "padding": (3, 3),
429 },
430 sort_keys=True,
431 ),
432 "this": fitbounds,
433 }
434 )
435
436 assert "".join(fit_bounds_rendered.split()) in "".join(out.split())
437
438 bounds = self.m.get_bounds()
439 assert bounds == [[None, None], [None, None]], bounds
440
441 def test_custom_icon(self):
442 """Test CustomIcon."""

Callers

nothing calls this directly

Calls 3

get_boundsMethod · 0.80
fit_boundsMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected