gtfs icon indicating copy to clipboard operation
gtfs copied to clipboard

do not raise exception when an optional source file is missing

Open flavray opened this issue 10 years ago • 0 comments

Fix #12 - missing optional files normally do not raise GTFS::InvalidSourceException anymore

If an optional file is missing, parse_entity yields a new empty instance of StringIO, when calling read on this StringIO, an empty string will be returned causing parse_models to return an empty array. If a required file is missing, raise GTFS::InvalidSourceException as before.

I added a test on transfers field, transfers.txt is missing in valid_gtfs_missing_optional_files.zip but calling source.transfers does not raise an exception anymore :)

flavray avatar Sep 12 '15 19:09 flavray