Closed crdanielbusch closed 20 hours ago
Now would be a good time to move the content of setup_for_wrf
into a function
This is ready to be reviewed @lewisjared.
Thanks for the tip. I wasn't sure if it was necessary to move everything into a function. But it looks much better now.
I've started to write tests for the click implementation, but it turned out to be rather difficult. In the tests, we would need to run the function that takes the command line arguments and runs the whole script. But running the whole script does not really work locally. Do you have another idea how to tests this? Or maybe click tests are not super important here?
I've started to write tests for the click implementation, but it turned out to be rather difficult.
Take a look at tests/integration/sat_data/test_fetch.py
in the openmethane project. That shows how you can run click cli tools without subprocess shenanigans.
You are right though that testing a large single function app like this is hard. Often the CLI part of the codebase is a very thin function which calls out to other functions. That function is just responsible for moving the command line arguments to the function.
Description
Change the command line interface from the
argparse
library toclick
.Checklist
Please confirm that this pull request has done the following:
Notes