Path: blob/main/tests/plugins/test_float_image.py
1601 views
"""1Test FloatImage2---------------3"""45import folium6from folium import plugins7from folium.template import Template8from folium.utilities import normalize91011def test_float_image():12m = folium.Map([45.0, 3.0], zoom_start=4)13url = "https://raw.githubusercontent.com/SECOORA/static_assets/master/maps/img/rose.png"14szt = plugins.FloatImage(url, bottom=60, left=70, width="20%")15m.add_child(szt)16m._repr_html_()1718out = normalize(m._parent.render())1920# Verify that the div has been created.21tmpl = Template(22"""23<img id="{{this.get_name()}}" alt="float_image"24src="https://raw.githubusercontent.com/SECOORA/static_assets/master/maps/img/rose.png"25style="z-index: 999999">26</img>27"""28)29assert normalize(tmpl.render(this=szt)) in out3031# Verify that the style has been created.32tmpl = Template(33"""34<style>35#{{this.get_name()}} {36position: absolute;37bottom: 60%;38left: 70%;39width: 20%;40}41</style>42"""43)44assert normalize(tmpl.render(this=szt)) in out4546bounds = m.get_bounds()47assert bounds == [[None, None], [None, None]], bounds484950