1
- [ ![ python: 3.9 ] ( https://img.shields.io/badge/Python-3.9 -green )] ( https://img.shields.io/badge/Python-3.9 -green )
1
+ [ ![ python: 3.13 ] ( https://img.shields.io/badge/Python-3.13 -green )] ( https://img.shields.io/badge/Python-3.13 -green )
2
2
[ ![ AWS: Lambda] ( https://img.shields.io/badge/AWS-Lambda-blueviolet )] ( https://img.shields.io/badge/AWS-Lambda-blueviolet )
3
3
[ ![ test: unit] ( https://img.shields.io/badge/Test-Unit-blue )] ( https://img.shields.io/badge/Test-Unit-blue )
4
4
[ ![ test: integration] ( https://img.shields.io/badge/Test-Integration-yellow )] ( https://img.shields.io/badge/Test-Integration-yellow )
@@ -45,7 +45,7 @@ The SAM CLI extends the AWS CLI that adds functionality for building and testing
45
45
To use the SAM CLI, you need the following tools.
46
46
47
47
* SAM CLI - [ Install the SAM CLI] ( https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html )
48
- * Python 3 - [ Install Python 3] ( https://www.python.org/downloads/ )
48
+ * Python 3.13 - [ Install Python 3.13 ] ( https://www.python.org/downloads/ )
49
49
* Docker - [ Install Docker community edition] ( https://hub.docker.com/search/?type=edition&offering=community )
50
50
51
51
[[ top]] ( #python-test-samples-project )
@@ -172,11 +172,15 @@ The project uses the [moto](http://docs.getmoto.org/en/latest/) dependency libra
172
172
# Create and Activate a Python Virtual Environment
173
173
174
174
pip3 install virtualenv
175
- python3 -m venv venv
175
+ python3 -m virtualenv venv
176
176
source ./venv/bin/activate
177
177
178
- # install dependencies
178
+ # Verify Python version (Should show Python 3.13.x)
179
+
180
+ python3 --version
181
+ pip3 --version
179
182
183
+ # install dependencies
180
184
pip3 install -r tests/requirements.txt
181
185
182
186
# run unit tests with mocks
@@ -202,7 +206,7 @@ The `AWS CLI` enables you to invoke a Lambda function in the cloud.
202
206
` ` ` shell
203
207
# invoke a Lambda function in the cloud using the AWS CLI. Substitute the function name as created in your stack.
204
208
205
- aws lambda invoke --function-name apigw-lambda-PythonTestDemo-6Ecinx8IauZv outfile.txt
209
+ aws lambda invoke --function-name apigw-lambda-PythonTestDemo-XlkJiaHvJn1t outfile.txt
206
210
` ` `
207
211
[[top]](#python-test-samples-project)
208
212
@@ -218,7 +222,7 @@ sam logs -n PythonTestDemo --stack-name apigw-lambda --tail
218
222
In a new terminal, curl the API Gateway and watch the log output.
219
223
220
224
` ` ` shell
221
- curl <API Gateway url>
225
+ curl https:// <API Gateway deploy>.execute-api.eu-west-1.amazonaws.com/Prod/hello
222
226
` ` `
223
227
224
228
You can find more information and examples about filtering Lambda function logs in the [SAM CLI Documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-logging.html).
0 commit comments