osm2gtfs icon indicating copy to clipboard operation
osm2gtfs copied to clipboard

Core tests

Open pantierra opened this issue 6 years ago • 2 comments

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 avatar Dec 23 '17 23:12 pantierra

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 an Configuration 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 of Line, Itinerary, Station and Stop 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 with route_master, some without; some stops united in a stop_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.

pantierra avatar Dec 23 '17 23:12 pantierra

creator_factory tests are included in #83.

pantierra avatar Feb 28 '18 23:02 pantierra