Skip to content

Commit 3276d8d

Browse files
author
Martin Journois
committed
Add get_bounds in (almost) each test_features
1 parent 22be426 commit 3276d8d

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

tests/test_features.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ def test_figure_creation():
5858
f = features.Figure()
5959
assert isinstance(f, Element)
6060

61+
bounds = f.get_bounds()
62+
assert bounds == [[None, None], [None, None]], bounds
6163

6264
def test_figure_rendering():
6365
f = features.Figure()
6466
out = f.render()
6567
assert type(out) is text_type
6668

69+
bounds = f.get_bounds()
70+
assert bounds == [[None, None], [None, None]], bounds
6771

6872
def test_figure_html():
6973
f = features.Figure()
@@ -72,13 +76,18 @@ def test_figure_html():
7276
print(out)
7377
assert out.strip() == tmpl.strip()
7478

79+
bounds = f.get_bounds()
80+
assert bounds == [[None, None], [None, None]], bounds
7581

7682
def test_figure_double_rendering():
7783
f = features.Figure()
7884
out = f.render()
7985
out2 = f.render()
8086
assert out == out2
8187

88+
bounds = f.get_bounds()
89+
assert bounds == [[None, None], [None, None]], bounds
90+
8291
def test_marker_popups():
8392
m = Map()
8493
features.Marker([45,-180],popup='-180').add_to(m)
@@ -89,6 +98,9 @@ def test_marker_popups():
8998
features.CircleMarker([45,120],popup=Popup('120')).add_to(m)
9099
m._repr_html_()
91100

101+
bounds = m.get_bounds()
102+
assert bounds == [[45, -180], [45, 120]], bounds
103+
92104
def test_polyline_popups():
93105
m = Map([43,-100], zoom_start=4)
94106
features.PolyLine([[40,-80],[45,-80]], popup="PolyLine").add_to(m)
@@ -97,6 +109,9 @@ def test_polyline_popups():
97109
features.MultiPolyLine([[[40,-120],[45,-120]]], popup=Popup("MultiPolyLine")).add_to(m)
98110
m._repr_html_()
99111

112+
bounds = m.get_bounds()
113+
assert bounds == [[40, -120], [45, -80]], bounds
114+
100115
# DivIcon.
101116
def test_divicon():
102117
html = """<svg height="100" width="100">
@@ -107,7 +122,6 @@ def test_divicon():
107122
assert div.className == 'empty'
108123
assert div.html == html
109124

110-
111125
# WmsTileLayer
112126
def test_wms_service():
113127
m = Map([40, -100], zoom_start=4)
@@ -120,3 +134,6 @@ def test_wms_service():
120134
transparent=True)
121135
w.add_to(m)
122136
m._repr_html_()
137+
138+
bounds = m.get_bounds()
139+
assert bounds == [[None, None], [None, None]], bounds

0 commit comments

Comments
 (0)