def test_image_overlay():
 data = [[[1, 0, 0, 1], [0, 0, 0, 0], [0, 0, 0, 0]], [[1, 1, 0, 0.5], [0, 0, 1, 1], [0, 0, 1, 1]]]
 m = folium.Map()
 io = plugins.ImageOverlay(data, [[0, (-180)], [90, 180]], mercator_project=True)
 io.add_to(m)
 m._repr_html_()
 out = m._parent.render()
 url = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAF0lEQVR42mP4z8AARFDw/z/DeiA5H4QBV60H6ABl9ZIAAAAASUVORK5CYII='
 assert (io.url == url)
 tmpl = Template("\n                var {{this.get_name()}} = L.imageOverlay(\n                    '{{ this.url }}',\n                    {{ this.bounds }},\n                    {{ this.options }}\n                    ).addTo({{this._parent.get_name()}});\n    ")
 assert (tmpl.render(this=io) in out)
 bounds = m.get_bounds()
 assert (bounds == [[0, (-180)], [90, 180]]), bounds

def test_image_overlay ( ) : data = [ [ [ 1 , 0 , 0 , 1 ] , [ 0 , 0 , 0 , 0 ] , [ 0 , 0 , 0 , 0 ] ] , [ [ 1 , 1 , 0 , 0.5 ] , [ 0 , 0 , 1 , 1 ] , [ 0 , 0 , 1 , 1 ] ] ] m = folium . Map ( ) io = plugins . ImageOverlay ( data , [ [ 0 , ( - 180 ) ] , [ 90 , 180 ] ] , mercator_project = True ) io . add_to ( m ) m . _repr_html_ ( ) out = m . _parent . render ( ) url = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAF0lEQVR42mP4z8AARFDw/z/DeiA5H4QBV60H6ABl9ZIAAAAASUVORK5CYII=' assert ( io . url == url ) tmpl = Template ( "\n                var {{this.get_name()}} = L.imageOverlay(\n                    '{{ this.url }}',\n                    {{ this.bounds }},\n                    {{ this.options }}\n                    ).addTo({{this._parent.get_name()}});\n    " ) assert ( tmpl . render ( this = io ) in out ) bounds = m . get_bounds ( ) assert ( bounds == [ [ 0 , ( - 180 ) ] , [ 90 , 180 ] ] ) , bounds
test image overlay .