omniscale / imposm2

Imports OpenStreetMap data into geo databases
http://imposm.org
Apache License 2.0
116 stars 24 forks source link

Check connection before reading. Fail if unable to connect #26

Closed llimllib closed 11 years ago

llimllib commented 11 years ago

The motivation for this is that, if you set imposm to a long read, you may not be around when it finishes. If somebody starts up imposm with a read and a write, make sure we can at least connect to the DB before beginning the write.

If we can't connect, print the error and quit so the user can either remove the write option or fix his DB parameters.

llimllib commented 11 years ago

I'd like to test this change but it's not clear to me how to do so, or even how to run the tests. Can somebody help me with that?

olt commented 11 years ago

Thanks for your pull request.

You should be able to run the tests with pip install nose and nosetests imposm, but the command line interface doesn't have tests. :-/