diff --git a/tests/data/LAD_boundaries.geojson b/tests/data/LAD_boundaries.geojson new file mode 100644 index 0000000..69a5c88 --- /dev/null +++ b/tests/data/LAD_boundaries.geojson @@ -0,0 +1,7 @@ +{ +"type": "FeatureCollection", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, +"features": [ +{ "type": "Feature", "properties": { "FID": 1, "LAD23CD": "E06000001", "LAD23NM": "Hartlepool", "LAD23NMW": " ", "BNG_E": 447160, "BNG_N": 531474, "LONG": -1.27018, "LAT": 54.67614, "Shape__Area": 94377395.557937607, "Shape__Length": 56887.705862766503, "GlobalID": "486a5ba1-07f6-4a73-80f4-4f1683a5eaf7" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ -1.24193513701543, 54.722723705072802 ], [ -1.24251971578362, 54.722430799890901 ], [ -1.24319929037027, 54.722632537252402 ], [ -1.24224977186981, 54.7229622269044 ], [ -1.24193513701543, 54.722723705072802 ] ] ], [ [ [ -1.25856139746239, 54.726055452010698 ], [ -1.25186499193155, 54.719622989845497 ], [ -1.24351651180576, 54.722522389782497 ], [ -1.24283952060187, 54.722263899539001 ], [ -1.23159383411259, 54.717699966540401 ], [ -1.21002901072878, 54.708942129390998 ], [ -1.17569729724445, 54.696746592360903 ], [ -1.17433678023129, 54.693162175752398 ], [ -1.17402616261033, 54.691993195399903 ], [ -1.17455342485774, 54.6923560565196 ], [ -1.17701764299862, 54.6946474887134 ], [ -1.18489073828338, 54.693291584884399 ], [ -1.19277511911233, 54.700491462095101 ], [ -1.19632938053034, 54.698564967623298 ], [ -1.18750965082326, 54.6939094540718 ], [ -1.1959399031887, 54.692361413422603 ], [ -1.19408689998301, 54.690219831306202 ], [ -1.1945192059421, 54.689715763041903 ], [ -1.19788237012063, 54.6918053802518 ], [ -1.19867872582023, 54.686257517711702 ], [ -1.19680601621656, 54.687049106140599 ], [ -1.19759897538427, 54.686124341450501 ], [ -1.19885420435152, 54.685383330279599 ], [ -1.19849609670622, 54.679642924932097 ], [ -1.19849239250194, 54.679583530863297 ], [ -1.19731505826709, 54.678167164420699 ], [ -1.17610694079305, 54.653628600083401 ], [ -1.16476091636409, 54.647605289681103 ], [ -1.15830866546583, 54.648323712851699 ], [ -1.15798025196481, 54.648313452933699 ], [ -1.16879885892195, 54.644289051647597 ], [ -1.1617987909207, 54.635423038630897 ], [ -1.1663887690271, 54.637263739368699 ], [ -1.16592472164367, 54.633894108647098 ], [ -1.16042471112156, 54.635192446646599 ], [ -1.16559110623118, 54.631876084723203 ], [ -1.18876265284135, 54.632651107137498 ], [ -1.20026300149, 54.623411929059003 ], [ -1.20524163140224, 54.622734364648998 ], [ -1.21246349364724, 54.6222818736317 ], [ -1.21263514524583, 54.621727729860197 ], [ -1.22027645913807, 54.625162410450102 ], [ -1.22399764850212, 54.623660344445803 ], [ -1.22338460532148, 54.626408169614898 ], [ -1.23209654398617, 54.625623413168 ], [ -1.23401825954732, 54.628868968169201 ], [ -1.24062013790598, 54.624709276277798 ], [ -1.24430424329071, 54.625651801702098 ], [ -1.26747852931111, 54.624558313153997 ], [ -1.27987524998092, 54.628246272287399 ], [ -1.29619907178162, 54.628027653653 ], [ -1.29859409909729, 54.6311572470523 ], [ -1.29811630592792, 54.635240745928897 ], [ -1.30697991122656, 54.636949765672 ], [ -1.31636432536428, 54.645234852452703 ], [ -1.32886363882166, 54.644001609293902 ], [ -1.33506092900011, 54.631323968058403 ], [ -1.33971827924549, 54.636247217253299 ], [ -1.35682697795192, 54.638376384355702 ], [ -1.36783184630663, 54.643471365777998 ], [ -1.38084708286666, 54.643802224740398 ], [ -1.38376395297565, 54.646243002272399 ], [ -1.34122267082448, 54.650243261589303 ], [ -1.34787134473742, 54.6624292323825 ], [ -1.34354391967703, 54.668611541296201 ], [ -1.33306463906303, 54.672613552901304 ], [ -1.33094416840882, 54.682161719316497 ], [ -1.33449018998271, 54.689017702212702 ], [ -1.34460276908376, 54.6908262663923 ], [ -1.31936389932285, 54.691297449684797 ], [ -1.3134958536303, 54.697086537899601 ], [ -1.31387919174122, 54.701197161639399 ], [ -1.30132484271011, 54.708091652767401 ], [ -1.30367367897698, 54.718507674943098 ], [ -1.29030145716217, 54.7183978461862 ], [ -1.2702517668578, 54.727168687781003 ], [ -1.25856139746239, 54.726055452010698 ] ] ] ] } } +] +} diff --git a/tests/setup/test_StaticDataIngest.py b/tests/setup/test_StaticDataIngest.py index 7925943..7868ab8 100644 --- a/tests/setup/test_StaticDataIngest.py +++ b/tests/setup/test_StaticDataIngest.py @@ -24,3 +24,14 @@ def test_ingest_bus_timetable_file_exists(): == "The file you are downloading to already exists (timetable)" ) os.remove(os.path.join(TESTS_DATA_PATH, f"north_east_{date}.zip")) + + +def test_ingest_data_from_geoportal_path_exists(): + """Simple test to check abort if file exists locally.""" + with pytest.raises(FileExistsError) as excinfo: + filename = "tests/data/LAD_boundaries.geojson" + tool.ingest_data_from_geoportal(filename=filename) + assert ( + str(excinfo.value) + == "The file you are downloading to already exists (bounds)" + )