-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce ISO 3166-2 country codes for creator directories
Introduce tests for creator factory
- Loading branch information
Showing
30 changed files
with
233 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
*.log | ||
*.zip | ||
*.pkl | ||
config.json | ||
./config.json | ||
data | ||
src | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,48 @@ | ||
osm2gtfs tests | ||
============== | ||
|
||
Accra | ||
------ | ||
To run all the tests (from the root `osm2gtfs` folder) : | ||
|
||
$ python -m unittest discover -v -t . | ||
|
||
## Core | ||
|
||
Tests for core components must be named and placed in the following schema: | ||
`core/test_<FILENAME>.py` | ||
|
||
### Creators Factory | ||
|
||
#### Description | ||
|
||
The creator factory allows certain parts of the GTFS generation from OSM data | ||
to be overridden by different regions and networks. The tests make sure that | ||
newly added creators follow the established naming convention of: | ||
`<ISO 3166-2 two letter country code>_<city/state/region>[_<network/operator>]` | ||
|
||
#### How to run | ||
|
||
$ python osm2gtfs/tests/core/tests_creator_factory.py | ||
|
||
## Creators | ||
|
||
Tests for core components must be named and placed in the following schema: | ||
`creators/test_<SELECTOR>.py` | ||
|
||
### Accra, Ghana | ||
|
||
#### Description | ||
|
||
There are 3 unittests for the Accra GTFS generation | ||
There are 3 acceptance tests for the Accra GTFS generation | ||
|
||
1. Obtain mock-up data on stops from OpenStreetMap and cache it, | ||
1. Obtain mock-up data on routes from OpenStreetMap and cache it, | ||
1. Generate GTFS file from using the previously generated cache data. | ||
|
||
#### Validation of the GTFS | ||
|
||
The generated GTFS is checked against a reference GTFS file (accra_tests.zip.ref) | ||
in the `tests/fixtures/accra/` folder. For the moment, only the size of each GTFS file is compared to the reference. | ||
The generated GTFS is checked against a reference GTFS file (gh_accra_tests.zip.ref) | ||
in the `tests/creators/fixtures/gh_accra/` folder. For the moment, only the size of each GTFS file is compared to the reference. | ||
|
||
#### How to run | ||
To run all the tests (from the root `osm2gtfs` folder) : | ||
|
||
$ python -m unittest discover | ||
|
||
To run only the Accra tests : | ||
|
||
$ python osm2gtfs/tests/tests_accra.py | ||
$ python osm2gtfs/tests/creators/tests_gh_accra.py |
Empty file.
Oops, something went wrong.