Skip to content

Commit b50b38d

Browse files
authored
test: fix start-lambda-no-containers test (#8490)
Also move the creation of the local Lambda client to a separate function
1 parent a367657 commit b50b38d

2 files changed

Lines changed: 53 additions & 213 deletions

File tree

tests/integration/local/start_lambda/start_lambda_api_integ_base.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import logging
99
from pathlib import Path
1010

11+
import boto3
12+
from botocore import UNSIGNED
13+
from botocore.config import Config
1114
from docker.errors import APIError
1215
from psutil import NoSuchProcess
1316

@@ -225,6 +228,17 @@ def tearDownClass(cls):
225228
except Exception as ex:
226229
LOG.error("Failed to clean up SAM CLI containers", exc_info=ex)
227230

231+
def get_local_lambda_client(self):
232+
url = "http://127.0.0.1:{}".format(self.port)
233+
return boto3.client(
234+
"lambda",
235+
endpoint_url=url,
236+
region_name="us-east-1",
237+
use_ssl=False,
238+
verify=False,
239+
config=Config(signature_version=UNSIGNED, read_timeout=120, retries={"max_attempts": 0}),
240+
)
241+
228242

229243
class WatchWarmContainersIntegBaseClass(StartLambdaIntegBaseClass):
230244
temp_path: Optional[str] = None

0 commit comments

Comments
 (0)