Skip to content

Add tests for jobs/aws_utils.py #4527

Open
@Zahed-Riyaz

Description

@Zahed-Riyaz

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.mock module to simulate external method behaviour such as simulating boto3 sessions or aws credential generation, etc.
  • To verify if Signer object returns the correct URL with the accurate parameters, we patch the RequestSigned method, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions