mysociety / global.mapit.mysociety.org

Installation of MapIt using global OpenStreetMap data
http://global.mapit.mysociety.org/
Other
1 stars 1 forks source link

Add Python 3 compatibility and automated tests for data generation and import #4

Closed mhl closed 6 years ago

mhl commented 7 years ago

There were existing doctests for the scripts that generate the KML files, but these weren't being run automatically. There were no tests at all for the import script, which meant that making any changes to it all is a nerve-wracking business, and it could do with some refactoring. This pull request uses py.test to run the existing doctests, and adds Django tests for the mapit_global_import management command. Test coverage reports are generated and submitted to coveralls.io.

This pull request also make changes to the code that should enable it to be run under Python 3 as well as Python 2, and tox is used to run the scripts on Python versions that might be currently relevant.

mhl commented 6 years ago

Hi @dracos - I think I addressed all your comments on this pull request - are you OK with me squashing the fixups and merging that now?

coveralls commented 6 years ago

Coverage Status

Changes Unknown when pulling a95a19b0e957ceee26660b0fc94a1a98a4b569f3 on add-global-import-tests into on master.

coveralls commented 6 years ago

Coverage Status

Changes Unknown when pulling 5f9257e6c40dac6d148e74f24221b80125f3dbbf on add-global-import-tests into on master.

coveralls commented 6 years ago

Coverage Status

Changes Unknown when pulling 7b30acf8d2e174e825e87ae45e05db2a9683f20a on add-global-import-tests into on master.

mhl commented 6 years ago

Yeah, there were a couple of changes needed for the new build environment, it turned out, and I spotted a couple more places where requests to overpass weren't being patched, so I fixed those things too before merging.