-
Notifications
You must be signed in to change notification settings - Fork 3
Testing
Tests exist for each module (i.e. lidar_fetch).
Github Actions are used to run tests after each push to remote (i.e. github). Miniconda from the GitHub Actions marketplace is used to install the package dependencies. Linting with Flake8 and testing with PyTest is then performed. Several tests require an API key. This is stored as a GitHub secret and accessed by the workflow.
See Package Requirements for details about the required API tokens. This blog was used to create the secret string directly from an .env
file, and to set the GitHub Actions workflow to create a local instance of the .env
file for each workflow run.
Check the actions tab after you push to check if your tests run successfully.
The test_vector_fetch
requires a LINZ API token. Create an API token using the instructions under the Requirements section then store it in an .env
file under root.
LINZ_API="COPY_YOUR_API_KEY_HERE"
In the conda environment defined in the root\environment.yml
, run the following in the repository root folder:
- to run individual tests call
python -m tests.lidar_fetch_test.lidar_fetch_test
orpython -m tests.test_vector_fetch.test_vector_fetch
etc. - to run all tests call
python -m unittest