Skip to content

Commit

Permalink
Fix marker cluster test
Browse files Browse the repository at this point in the history
  • Loading branch information
Conengmo committed Nov 27, 2023
1 parent 633d600 commit 7e7b152
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/plugins/test_marker_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,7 @@ def test_marker_cluster():
m = folium.Map([45.0, 3.0], zoom_start=4)
mc = plugins.MarkerCluster(data).add_to(m)

out = normalize(m._parent.render())

# We verify that imports
assert (
'<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.1.0/leaflet.markercluster.js"></script>' # noqa
in out
) # noqa
assert (
'<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.1.0/MarkerCluster.css"/>' # noqa
in out
) # noqa
assert (
'<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.1.0/MarkerCluster.Default.css"/>' # noqa
in out
) # noqa

# Verify the script part is okay.
tmpl = Template(
tmpl_for_expected = Template(
"""
var {{this.get_name()}} = L.markerClusterGroup(
{{ this.options|tojson }}
Expand All @@ -60,7 +43,24 @@ def test_marker_cluster():
{{ this.get_name() }}.addTo({{ this._parent.get_name() }});
"""
)
expected = normalize(tmpl.render(this=mc))
expected = normalize(tmpl_for_expected.render(this=mc))

out = normalize(m._parent.render())

# We verify that imports
assert (
'<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.1.0/leaflet.markercluster.js"></script>' # noqa
in out
) # noqa
assert (
'<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.1.0/MarkerCluster.css"/>' # noqa
in out
) # noqa
assert (
'<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.1.0/MarkerCluster.Default.css"/>' # noqa
in out
) # noqa

assert expected in out

bounds = m.get_bounds()
Expand Down

0 comments on commit 7e7b152

Please sign in to comment.