TopoToolbox / pytopotoolbox

Python interface to TopoToolbox
https://topotoolbox.github.io/pytopotoolbox/
GNU General Public License v3.0
1 stars 2 forks source link

Implement automated tests #41

Closed wkearn closed 1 week ago

wkearn commented 1 month ago

A few remaining issues are waiting on getting an automated testing framework set up (#18 #27).

We do run one test in CI currently:

import topotoolbox as topo

dem = topo.gen_random()
assert (dem.fillsinks() >= dem).z.all()

which I added more or less to ensure that everything is built and linked properly. This is run on the command line with python -c, so we could start with turning that script into a proper test.

We should at least run all the other public API functions.

The test dem.fillsinks() >= dem is a property-based test that we also check in the libtopotoolbox tests. Those tests in libtopotoolbox should catch errors in the libtopotoolbox implementation, but it might be useful to run some of them in pytopotoolbox to make sure that we're passing arguments and managing the results correctly. The libtopotoolbox tests are quite messy, and it might be hard to figure out what they are testing, so I'll work on cleaning them up and documenting the properties more explicitly.