Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
python-visualization
GitHub Repository: python-visualization/folium
Path: blob/main/tests/plugins/test_geoman.py
1601 views
1
"""
2
Test GeoMan
3
----------------
4
5
"""
6
7
import folium
8
from folium import plugins
9
from folium.template import Template
10
from folium.utilities import normalize
11
12
13
def test_geoman():
14
m = folium.Map([47, 3], zoom_start=1)
15
fs = plugins.GeoMan().add_to(m)
16
17
out = normalize(m._parent.render())
18
19
# verify that the GeoMan plugin was added to
20
# the map
21
tmpl = Template(
22
"""
23
{{this.get_name()}}.addControls(
24
{{this.options|tojavascript}}
25
)
26
"""
27
)
28
29
assert normalize(tmpl.render(this=fs)) in out
30
31