def test_styler_kwarg(self, ShapelyFeature, add_feature_method): ax = GeoAxes(plt.figure(), [0, 0, 1, 1], map_projection=ccrs.Robinson()) ax.add_geometries(mock.sentinel.geometries, mock.sentinel.crs, styler=mock.sentinel.styler, wibble='wobble') ShapelyFeature.assert_called_once_with( mock.sentinel.geometries, mock.sentinel.crs, wibble='wobble') add_feature_method.assert_called_once_with( ShapelyFeature(), styler=mock.sentinel.styler)
def test_styler_kwarg(self, ShapelyFeature, add_feature_method): ax = GeoAxes(plt.figure(), [0, 0, 1, 1], map_projection=ccrs.Robinson()) ax.add_geometries(mock.sentinel.geometries, mock.sentinel.crs, styler=mock.sentinel.styler, wibble='wobble') ShapelyFeature.assert_called_once_with( mock.sentinel.geometries, mock.sentinel.crs, wibble='wobble') add_feature_method.assert_called_once_with( ShapelyFeature(), styler=mock.sentinel.styler)
def test_single_geometry(self): # A single geometry is acceptable proj = ccrs.PlateCarree() ax = GeoAxes(plt.figure(), [0, 0, 1, 1], map_projection=proj) ax.add_geometries(next(cfeature.COASTLINE.geometries()), crs=proj)