Skip to content

Commit a633991

Browse files
author
Michael Brewer
authored
fix: correct tests
1 parent 76e7e28 commit a633991

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

tests/functional/event_handler/test_api_gateway.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
from aws_lambda_powertools.event_handler import content_types
1414
from aws_lambda_powertools.event_handler.api_gateway import (
15-
ALBEventResolver,
16-
APIGatewayProxyEventResolver,
17-
APIGatewayProxyEventV2Resolver,
15+
ALBResolver,
16+
APIGatewayHttpResolver,
1817
ApiGatewayResolver,
18+
APIGatewayRestResolver,
1919
CORSConfig,
2020
ProxyEventType,
2121
Response,
@@ -51,7 +51,7 @@ def read_media(file_name: str) -> bytes:
5151

5252
def test_alb_event():
5353
# GIVEN an Application Load Balancer proxy type event
54-
app = ALBEventResolver()
54+
app = ALBResolver()
5555

5656
@app.get("/lambda")
5757
def foo():
@@ -72,7 +72,7 @@ def foo():
7272

7373
def test_api_gateway_v1():
7474
# GIVEN a Http API V1 proxy type event
75-
app = APIGatewayProxyEventResolver()
75+
app = APIGatewayRestResolver()
7676

7777
@app.get("/my/path")
7878
def get_lambda() -> Response:
@@ -111,7 +111,7 @@ def get_lambda() -> Response:
111111

112112
def test_api_gateway_v2():
113113
# GIVEN a Http API V2 proxy type event
114-
app = APIGatewayProxyEventV2Resolver()
114+
app = APIGatewayHttpResolver()
115115

116116
@app.post("/my/path")
117117
def my_path() -> Response:

tests/functional/test_metrics.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ def lambda_handler(evt, context):
496496
# THEN ColdStart metric and function_name and service dimension should be logged
497497
assert output["ColdStart"] == [1.0]
498498
assert output["function_name"] == "example_fn"
499-
assert output['service'] == service
499+
assert output["service"] == service
500+
500501

501502
def test_log_metrics_capture_cold_start_metric_no_service(capsys, namespace):
502503
# GIVEN Metrics is initialized without service
@@ -515,7 +516,7 @@ def lambda_handler(evt, context):
515516
# THEN ColdStart metric and function_name dimension should be logged
516517
assert output["ColdStart"] == [1.0]
517518
assert output["function_name"] == "example_fn"
518-
assert output.get('service') is None
519+
assert output.get("service") is None
519520

520521

521522
def test_emit_cold_start_metric_only_once(capsys, namespace, service, metric):

0 commit comments

Comments
 (0)