EvalAI
EvalAI copied to clipboard
Add tests for jobs/aws_utils.py
This issue is a sub-issue of #4476. It aims to add tests for jobs/aws_utils.py, and ensure 100% coverage.
The generate_aws_eks_bearer_token function currently uses get_aws_credentials_for_challenge to generate aws_keys.
- [ ] To isolate the tests for this function, I will use
unittests.mockmodule to simulate external method behaviour such as simulatingboto3sessions or aws credential generation, etc. - [ ] To verify if
Signerobject returns the correct URL with the accurate parameters, we patch theRequestSignedmethod, and then code expected parameters as defined in function to assert they are equal. - [ ] And finally ensure that the URL returns the token when decoded at the end.
I will raise a PR implementing the above.