File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 55import json
66import time
77
8+ API_NAME = 'QuizAPI'
9+ STAGE_NAME = "prod"
10+
11+
812@pytest .fixture (scope = 'module' )
913def api_endpoint ():
1014 apigateway_client = boto3 .client ('apigateway' , endpoint_url = 'http://localhost:4566' )
1115 lambda_client = boto3 .client ('lambda' , endpoint_url = 'http://localhost:4566' )
1216
13- API_NAME = 'QuizAPI'
1417 response = apigateway_client .get_rest_apis ()
1518 api_list = response .get ('items' , [])
1619 api = next ((item for item in api_list if item ['name' ] == API_NAME ), None )
@@ -19,7 +22,7 @@ def api_endpoint():
1922 raise Exception (f"API { API_NAME } not found." )
2023
2124 API_ID = api ['id' ]
22- API_ENDPOINT = f"http://localhost:4566/_aws/execute-api/{ API_ID } /prod "
25+ API_ENDPOINT = f"http://localhost:4566/_aws/execute-api/{ API_ID } /{ STAGE_NAME } "
2326
2427 print (f"API Endpoint: { API_ENDPOINT } " )
2528
Original file line number Diff line number Diff line change 99from localstack .sdk .chaos .managers import fault_configuration
1010
1111LOCALSTACK_ENDPOINT = "http://localhost.localstack.cloud:4566"
12- API_NAME = 'QuizAPI'
12+ API_NAME = "QuizAPI"
13+ STAGE_NAME = "prod"
1314
1415class TestLocalStackClient :
1516 client = localstack .sdk .chaos .ChaosClient ()
@@ -28,7 +29,7 @@ def api_endpoint(apigateway_client):
2829 raise Exception (f"API { API_NAME } not found." )
2930
3031 API_ID = api ['id' ]
31- API_ENDPOINT = f"{ LOCALSTACK_ENDPOINT } /_aws/execute-api/{ API_ID } /test "
32+ API_ENDPOINT = f"{ LOCALSTACK_ENDPOINT } /_aws/execute-api/{ API_ID } /{ STAGE_NAME } "
3233
3334 print (f"API Endpoint: { API_ENDPOINT } " )
3435
You can’t perform that action at this time.
0 commit comments