Closed Gabrieldowen closed 5 months ago
looks good, useful for testing to make sure we are not losing notams.
you should look into writing tests as unittest
module unit tests so they can all be run and verified with a command as simple as python setup.py test
Are you talking about making a unit test for this script? Or in general more unit tests?
I'm arguing all tests that can be coded (i.e., automated) should be done so using existing tools that enable easy execution and reporting (which for Python means unittest
, or one of its alternatives, if you prefer). Having "tests" which are only executed by someone when they, first, remember the tests even exist, second, can find the right file to run, and, third, actually go and run them generally means ... the tests rarely or never get executed. Consolidating all tests to be run with a single command is a first good step to ensuring tests are regularly run. The next step will be to automate running tests on either commit, push, PR open, PR merge, or some other point in the development lifecycle.
This PR was just creating a method to get new data and save it locally. It is not meant to be a test but in the future it could potentially be used for one.
I figured it would be nice to have an easy way to save new test data. This function can be used from app.py by calling saveTestData(request, apiOuputs) by passing in the api output and the request used to get that output. Otherwise you can run the file itself manually changing the request variables. This will be especially useful when testing parsing function and translating