COSMOS is a web application designed to manage collections indexed in NASA's Science Discovery Engine (SDE), facilitating precise content selection and allowing metadata modification before indexing.
Create and run a set of tests for the Api class to ensure it handles authentication, endpoint requests, and response parsing correctly. This includes verifying that each endpoint (query or SQL) uses the correct type of credentials (username/password or token), and behaves appropriately when tokens are missing. The tests should also cover error handling for cases such as missing tokens and unsuccessful requests.
Implementation Considerations
-
Deliverable
An api_tests.py file that can be executed to validate token verification, request accuracy, response parsing, and basic error handling for the API.
Description
Create and run a set of tests for the Api class to ensure it handles authentication, endpoint requests, and response parsing correctly. This includes verifying that each endpoint (query or SQL) uses the correct type of credentials (username/password or token), and behaves appropriately when tokens are missing. The tests should also cover error handling for cases such as missing tokens and unsuccessful requests.
Implementation Considerations
-
Deliverable
An api_tests.py file that can be executed to validate token verification, request accuracy, response parsing, and basic error handling for the API.
Dependencies
No response