Core tests
Opened this issue · 2 comments
pantierra commented
Coming from the issue on regression tests #75, it probably makes sense to plan a bit on the tests for the code pieces living in the directory core
of osm2gtfs.
pantierra commented
Let's have a quick overview of what we've got here and some brainstormy briefings; please add what I'm missing or correct in what is wrong or can be improved:
cache.py
: Tests should be straightforward. Basically caching and restoring and comparing those. Based on the mock-up data.configuration.py
: Also straightforward, based on mock-up data it creates anConfiguration
object and verifies it's attributes.creator_factory.py
: Should test if the factory process works and also include tests for making sure that creators stick to the naming conventions, etc.elements.py
: On the programming side, it seems to be straightforward, as basically the different objects ofLine
,Itinerary
,Station
andStop
needs to be build by mock-up data (overpass result objects) and checked for their attributes. However I think the challenge and power of this part is actually in building good mock-up data. The different data here is concretely reflecting use cases, for example having routes withroute_master
, some without; some stops united in astop_area
and some not, etc...helper.py
: Tests for the particular static functions are straightforward to write.osm_connector.py
: This is a very interesting one. How to test the OSM connector? Data may change on OSM and we have to verify if querying and other things are working. Probably we have to think about suitable overpass queries to test particular functions of this module.