import unittest import geopandas as gpd import pandas as pd from shapely.geometry import Point from context import measprocess as mpc class TestPlottingOSM(unittest.TestCase): def setUp(self): complete_dataset = pd.read_csv( "tests/example_files/gps_test/gps.csv", index_col=0 ) gps_series = complete_dataset[["Lon.", "Lat."]].values self._gps_series = gpd.GeoSeries((Point(lon, lat) for lon, lat in gps_series)) def test_basic(self): # Check if no exception comes up series = self._gps_series.set_crs("EPSG:4326") mpc.plotting.plot_locations_osm(series, show=False) def test_exception_epsg(self): with self.assertRaises(ValueError): series = self._gps_series # .set_crs("EPSG:4326") mpc.plotting.plot_locations_osm(series, show=False) def test_kwargs_basic(self): series = self._gps_series.set_crs("EPSG:4326") mpc.plotting.plot_locations_osm(series, show=False, color="red") def test_kwargs_double(self): # s is based twice here with self.assertRaises(TypeError): series = self._gps_series.set_crs("EPSG:4326") mpc.plotting.plot_locations_osm(series, show=False, s=100, color="red") if __name__ == "__main__": unittest.main()