OU-CS-Capstone-2024 / NOTAMyWatch

Group Capstone project at the University of Oklahoma. Project consists of creating an app that will more effectively warn pilots about airspace hazards. Using the FAA API for NOTAMs.
0 stars 0 forks source link

add function to create new test data #69

Closed Gabrieldowen closed 5 months ago

Gabrieldowen commented 5 months ago

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

JmzCS50 commented 5 months ago

looks good, useful for testing to make sure we are not losing notams.

n-grounds commented 5 months ago

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

Gabrieldowen commented 5 months ago

Are you talking about making a unit test for this script? Or in general more unit tests?

n-grounds commented 5 months ago

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.

Gabrieldowen commented 5 months ago

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.