Test topojson smooth factor method.
(self)
| 174 | assert bounds == [[45, -30], [45, 30]], bounds |
| 175 | |
| 176 | def test_topo_json_smooth_factor(self): |
| 177 | """Test topojson smooth factor method.""" |
| 178 | self.m = folium.Map([43, -100], zoom_start=4) |
| 179 | |
| 180 | # Adding TopoJSON as additional layer. |
| 181 | with open(os.path.join(rootpath, "or_counties_topo.json")) as f: |
| 182 | choropleth = Choropleth( |
| 183 | f, topojson="objects.or_counties_geo", smooth_factor=0.5 |
| 184 | ).add_to(self.m) |
| 185 | |
| 186 | out = self.m._parent.render() |
| 187 | |
| 188 | # Verify TopoJson |
| 189 | topo_json = choropleth.geojson |
| 190 | topojson_str = topo_json._template.module.script(topo_json) |
| 191 | assert "".join(topojson_str.split())[:-1] in "".join(out.split()) |
| 192 | |
| 193 | def test_choropleth_features(self): |
| 194 | """Test to make sure that Choropleth function doesn't allow |
nothing calls this directly
no test coverage detected