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

Function test_popup_show

tests/test_map.py:131–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129
130
131def test_popup_show():
132 m = Map()
133 popup = Popup("Some text.", show=True).add_to(m)
134 rendered = popup._template.render(this=popup, kwargs={})
135 expected = """
136 var {popup_name} = L.popup({{
137 "maxWidth": "100%","autoClose": false,
138 }});
139 var {html_name} = $(`<div id="{html_name}" style="width: 100.0%; height: 100.0%;">Some text.</div>`)[0];
140 {popup_name}.setContent({html_name});
141 {map_name}.bindPopup({popup_name}).openPopup();
142 """.format(
143 popup_name=popup.get_name(),
144 html_name=list(popup.html._children.keys())[0],
145 map_name=m.get_name(),
146 )
147 # assert compare_rendered(rendered, expected)
148 assert normalize(rendered) == normalize(expected)
149
150
151def test_include():

Callers

nothing calls this directly

Calls 5

MapClass · 0.90
PopupClass · 0.90
normalizeFunction · 0.90
add_toMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected