()
| 154 | |
| 155 | |
| 156 | def test_rectangle(): |
| 157 | m = Map() |
| 158 | |
| 159 | location = [[45.6, -122.8], [45.61, -122.7]] |
| 160 | rectangle = Rectangle( |
| 161 | bounds=location, |
| 162 | popup="I am a rectangle", |
| 163 | color="black", |
| 164 | weight=2, |
| 165 | fill_opacity=0.6, |
| 166 | opacity=1, |
| 167 | fill=True, |
| 168 | ) |
| 169 | rectangle.add_to(m) |
| 170 | |
| 171 | expected_options = { |
| 172 | "bubblingMouseEvents": True, |
| 173 | "color": "black", |
| 174 | "dashArray": None, |
| 175 | "dashOffset": None, |
| 176 | "fill": True, |
| 177 | "fillColor": "black", |
| 178 | "fillOpacity": 0.6, |
| 179 | "fillRule": "evenodd", |
| 180 | "lineCap": "round", |
| 181 | "lineJoin": "round", |
| 182 | "noClip": False, |
| 183 | "opacity": 1, |
| 184 | "smoothFactor": 1.0, |
| 185 | "stroke": True, |
| 186 | "weight": 2, |
| 187 | } |
| 188 | |
| 189 | m._repr_html_() |
| 190 | expected_rendered = f""" |
| 191 | var {rectangle.get_name()} = L.rectangle( |
| 192 | {location}, |
| 193 | {{ |
| 194 | "bubblingMouseEvents": true, |
| 195 | "color": "black", |
| 196 | "dashArray": null, |
| 197 | "dashOffset": null, |
| 198 | "fill": true, |
| 199 | "fillColor": "black", |
| 200 | "fillOpacity": 0.6, |
| 201 | "fillRule": "evenodd", |
| 202 | "lineCap": "round", |
| 203 | "lineJoin": "round", |
| 204 | "noClip": false, |
| 205 | "opacity": 1, |
| 206 | "smoothFactor": 1.0, |
| 207 | "stroke": true, |
| 208 | "weight": 2 |
| 209 | }} |
| 210 | ) |
| 211 | .addTo({m.get_name()}); |
| 212 | """ |
| 213 |
nothing calls this directly
no test coverage detected