File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -529,6 +529,31 @@ def Reader(url):
529529 assert sf .shp .closed is sf .shx .closed is sf .dbf .closed is True
530530
531531
532+ ONHM_URL_PREFIX = "https://github.com/OpenNHM/AvaFrameData/blob/main/avaPopeletzbach"
533+ ONHM_SHAPEFILES = [
534+ "eventArea20090407" ,
535+ "eventDepositionArea20090407" ,
536+ "forest20090407" ,
537+ # "releaseArea20090407" is in this repo as ./shapefiles/test/REL.zip
538+ # and tested in test_reader_zip_polyylinez_no_m_itershaperecords
539+ ]
540+
541+
542+ @pytest .mark .network
543+ @pytest .mark .parametrize ("shp" , ONHM_SHAPEFILES )
544+ def test_reader_url_itershaperecords_ONHM_shapefiles (shp ):
545+ """
546+ Test reading a variety of Open Natural Hazard Modelling's Shapefiles.
547+ Just open them and iterate through. Don't assert anything,
548+ just test that no exception is raised.
549+ """
550+ if not shp .endswith (".shp" ):
551+ shp = f"{ shp } .shp"
552+ with shapefile .Reader (f"{ ONHM_URL_PREFIX } /{ shp } " ) as sf :
553+ for _shaperec in sf .iterShapeRecords ():
554+ pass
555+
556+
532557def test_reader_zip ():
533558 """
534559 Assert that Reader can open shapefiles inside a zipfile.
You can’t perform that action at this time.
0 commit comments