Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not raise exception when an optional source file is missing #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flavray
Copy link

@flavray flavray commented Sep 12, 2015

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 :)

Copy link
Collaborator

@stephenyeargin stephenyeargin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a swing at cleaning up the merge conflicts but ran into issues with the test case. If you have a second to merge master back into your branch I think we can get this one done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants