opengeos / open-buildings

Tools for working with open building datasets
https://opengeos.github.io/open-buildings
Other
119 stars 17 forks source link

Add tests #36

Open cholmes opened 9 months ago

cholmes commented 9 months ago

We have a nice CI system that checks multiple operating systems to be sure that all still works. But there's one big problem - there's no tests that it runs. It's been a one man project, but if the community grows it's essential to be able to automatically check if changes broke something unexpected (also good even when it is a one man project).

ChatGPT can likely help in the creation of tests. Would be good to have unit tests, and also some more integration tests that use the source.coop files to ensure it's all working.

felix-schott commented 8 months ago

Hi Chris, Do you mind if the tests use pytest instead of the unittest module? If so, I'll add some tests in the next couple days (I'm more comfortable with pytest). Note that it'll be easier to unit test things if the download function is decoupled from the CLI functionality. Also nicer to have a proper Python interface as this allows for more complex scripting applications. So the changes might involve some refactoring. I'm having a go locally and will push a PR in the next few days if you're fine with that! Cheers Felix

cholmes commented 8 months ago

Hey @felix-schott - that'd be awesome! I am totally happy with pytest if you're up to contribute. To be honest I've never written tests in Python - this is my first python coding project, so I'm more than happy for any guidance. And once the tests framework is in place I'll be sure to make use of it. And refactoring is definitely completely welcome as well, and it would be great to have a nice python interface.