@@ -15,7 +15,7 @@ def test_oms_js_inclusion():
15
15
Test that the OverlappingMarkerSpiderfier JavaScript library is included in the map.
16
16
"""
17
17
m = Map ([45.05 , 3.05 ], zoom_start = 14 )
18
- oms = OverlappingMarkerSpiderfier ().add_to (m )
18
+ OverlappingMarkerSpiderfier ().add_to (m )
19
19
20
20
rendered_map = m ._parent .render ()
21
21
assert (
@@ -38,16 +38,20 @@ def test_marker_addition():
38
38
).T
39
39
40
40
m = Map ([45.05 , 3.05 ], zoom_start = 14 )
41
- markers = [Marker (location = loc , popup = f"Marker {
42
- i } " ) for i , loc in enumerate (data )]
41
+ markers = [
42
+ Marker (
43
+ location = loc ,
44
+ popup = f"Marker { i } " ,
45
+ )
46
+ for i , loc in enumerate (data )
47
+ ]
43
48
44
49
for marker in markers :
45
50
marker .add_to (m )
46
51
47
- assert len (m ._children ) == len (markers ) + 1 , (
48
- f"Expected { len (markers )} markers on the map, but found {
49
- len (m ._children ) - 1 } ."
50
- )
52
+ assert (
53
+ len (m ._children ) == len (markers ) + 1
54
+ ), f"Expected { len (markers )} markers, found { len (m ._children ) - 1 } ."
51
55
52
56
53
57
def test_map_bounds ():
@@ -64,8 +68,14 @@ def test_map_bounds():
64
68
).T
65
69
66
70
m = Map ([45.05 , 3.05 ], zoom_start = 14 )
67
- markers = [Marker (location = loc , popup = f"Marker {
68
- i } " ) for i , loc in enumerate (data )]
71
+ markers = [
72
+ Marker (
73
+ location = loc ,
74
+ popup = f"Marker {
75
+ i } " ,
76
+ )
77
+ for i , loc in enumerate (data )
78
+ ]
69
79
70
80
for marker in markers :
71
81
marker .add_to (m )
@@ -76,10 +86,18 @@ def test_map_bounds():
76
86
min_lat , min_lon = data .min (axis = 0 )
77
87
max_lat , max_lon = data .max (axis = 0 )
78
88
79
- assert bounds [0 ][0 ] <= min_lat , "Map bounds do not correctly include the minimum latitude."
80
- assert bounds [0 ][1 ] <= min_lon , "Map bounds do not correctly include the minimum longitude."
81
- assert bounds [1 ][0 ] >= max_lat , "Map bounds do not correctly include the maximum latitude."
82
- assert bounds [1 ][1 ] >= max_lon , "Map bounds do not correctly include the maximum longitude."
89
+ assert (
90
+ bounds [0 ][0 ] <= min_lat
91
+ ), "Map bounds do not correctly include the minimum latitude."
92
+ assert (
93
+ bounds [0 ][1 ] <= min_lon
94
+ ), "Map bounds do not correctly include the minimum longitude."
95
+ assert (
96
+ bounds [1 ][0 ] >= max_lat
97
+ ), "Map bounds do not correctly include the maximum latitude."
98
+ assert (
99
+ bounds [1 ][1 ] >= max_lon
100
+ ), "Map bounds do not correctly include the maximum longitude."
83
101
84
102
85
103
def test_overlapping_marker_spiderfier_integration ():
@@ -88,9 +106,10 @@ def test_overlapping_marker_spiderfier_integration():
88
106
"""
89
107
m = Map ([45.05 , 3.05 ], zoom_start = 14 )
90
108
oms = OverlappingMarkerSpiderfier (
91
- options = {"keepSpiderfied" : True , "nearbyDistance" : 20 })
109
+ options = {"keepSpiderfied" : True , "nearbyDistance" : 20 }
110
+ )
92
111
oms .add_to (m )
93
112
94
- assert oms . get_name () in m . _children , (
95
- f"OverlappingMarkerSpiderfier is not correctly added to the map."
96
- )
113
+ assert (
114
+ oms . get_name () in m . _children
115
+ ), "OverlappingMarkerSpiderfier is not correctly added to the map."
0 commit comments