from common.src import aws from common.src.enums import AWSService, AWSRegion, AWSPayload class TestSession: _class = aws.Session def test_session_authentication(self): """Test the extension of the boto3 session by performing a simple operation which requires AWS credentials. Specifically, list lambda functions and confirm that the request was successful. """ session = self._class() client = session.client( service_name=AWSService.LAMBDA, region_name=AWSRegion.US_EAST_1, ) resp = client.list_functions() success = resp[AWSPayload.RESPONSE_METADATA][AWSPayload.HTTP_STATUS_CODE] == 200 assert success, "Are you sure you have AWS credentials?"