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

Function test_dual_map

tests/plugins/test_dual_map.py:12–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def test_dual_map():
13 m = folium.plugins.DualMap((0, 0))
14
15 folium.FeatureGroup(name="both").add_to(m)
16 folium.FeatureGroup(name="left").add_to(m.m1)
17 folium.FeatureGroup(name="right").add_to(m.m2)
18
19 figure = m.get_root()
20 assert isinstance(figure, folium.Figure)
21 out = normalize(figure.render())
22
23 script = '<script src="https://cdn.jsdelivr.net/gh/jieter/Leaflet.Sync/L.Map.Sync.min.js"></script>' # noqa
24 assert script in out
25
26 tmpl = Template(
27 """
28 {{ this.m1.get_name() }}.sync({{ this.m2.get_name() }});
29 {{ this.m2.get_name() }}.sync({{ this.m1.get_name() }});
30 """
31 )
32
33 assert normalize(tmpl.render(this=m)) in out

Callers

nothing calls this directly

Calls 4

normalizeFunction · 0.90
TemplateClass · 0.90
add_toMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected