Skip to content

Commit 6f291bf

Browse files
chore(ci): add the Parser feature to nox tests (#4584)
Adding Parser test
1 parent 4dee5d2 commit 6f291bf

24 files changed

+18
-16
lines changed

noxfile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_with_boto3_sdk_as_required_package(session: nox.Session):
117117

118118
@nox.session()
119119
def test_with_fastjsonschema_as_required_package(session: nox.Session):
120-
"""Tests that depends on boto3/botocore library"""
120+
"""Tests that depends on fastjsonschema library"""
121121
# Validation
122122
build_and_run_test(
123123
session,
@@ -145,14 +145,16 @@ def test_with_aws_encryption_sdk_as_required_package(session: nox.Session):
145145
@nox.session()
146146
@nox.parametrize("pydantic", ["1.10", "2.0"])
147147
def test_with_pydantic_required_package(session: nox.Session, pydantic: str):
148-
"""Tests that only depends for required libraries"""
148+
"""Tests that only depends for Pydantic library v1 and v2"""
149149
# Event Handler OpenAPI
150+
# Parser
150151

151152
session.install(f"pydantic>={pydantic}")
152153

153154
build_and_run_test(
154155
session,
155156
folders=[
156157
f"{PREFIX_TESTS_FUNCTIONAL}/event_handler/_pydantic/",
158+
f"{PREFIX_TESTS_UNIT}/parser/_pydantic/",
157159
],
158160
)

tests/unit/parser/_pydantic/__init__.py

Whitespace-only changes.
File renamed without changes.

tests/unit/parser/test_apigw.py renamed to tests/unit/parser/_pydantic/test_apigw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from aws_lambda_powertools.utilities.parser import envelopes, parse
55
from aws_lambda_powertools.utilities.parser.models import APIGatewayProxyEventModel
66
from tests.functional.utils import load_event
7-
from tests.unit.parser.schemas import MyApiGatewayBusiness
7+
from tests.unit.parser._pydantic.schemas import MyApiGatewayBusiness
88

99

1010
def test_apigw_event_with_envelope():

tests/unit/parser/test_apigwv2.py renamed to tests/unit/parser/_pydantic/test_apigwv2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
RequestContextV2Authorizer,
66
)
77
from tests.functional.utils import load_event
8-
from tests.unit.parser.schemas import MyApiGatewayBusiness
8+
from tests.unit.parser._pydantic.schemas import MyApiGatewayBusiness
99

1010

1111
def test_apigw_v2_event_with_envelope():

tests/unit/parser/test_bedrock_agent.py renamed to tests/unit/parser/_pydantic/test_bedrock_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from aws_lambda_powertools.utilities.parser import envelopes, parse
22
from aws_lambda_powertools.utilities.parser.models import BedrockAgentEventModel
33
from tests.functional.utils import load_event
4-
from tests.unit.parser.schemas import MyBedrockAgentBusiness
4+
from tests.unit.parser._pydantic.schemas import MyBedrockAgentBusiness
55

66

77
def test_bedrock_agent_event_with_envelope():

tests/unit/parser/test_cloudwatch.py renamed to tests/unit/parser/_pydantic/test_cloudwatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
CloudWatchLogsModel,
1212
)
1313
from tests.functional.utils import load_event
14-
from tests.unit.parser.schemas import MyCloudWatchBusiness
14+
from tests.unit.parser._pydantic.schemas import MyCloudWatchBusiness
1515

1616

1717
def decode_cloudwatch_raw_event(event: dict):

tests/unit/parser/test_dynamodb.py renamed to tests/unit/parser/_pydantic/test_dynamodb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from aws_lambda_powertools.utilities.parser import ValidationError, envelopes, parse
44
from tests.functional.utils import load_event
5-
from tests.unit.parser.schemas import MyAdvancedDynamoBusiness, MyDynamoBusiness
5+
from tests.unit.parser._pydantic.schemas import MyAdvancedDynamoBusiness, MyDynamoBusiness
66

77

88
def test_dynamo_db_stream_trigger_event():

tests/unit/parser/test_eventbridge.py renamed to tests/unit/parser/_pydantic/test_eventbridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from aws_lambda_powertools.utilities.parser import ValidationError, envelopes, parse
44
from tests.functional.utils import load_event
5-
from tests.unit.parser.schemas import (
5+
from tests.unit.parser._pydantic.schemas import (
66
MyAdvancedEventbridgeBusiness,
77
MyEventbridgeBusiness,
88
)

tests/unit/parser/test_kafka.py renamed to tests/unit/parser/_pydantic/test_kafka.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
KafkaSelfManagedEventModel,
66
)
77
from tests.functional.utils import load_event
8-
from tests.unit.parser.schemas import MyLambdaKafkaBusiness
8+
from tests.unit.parser._pydantic.schemas import MyLambdaKafkaBusiness
99

1010

1111
def test_kafka_msk_event_with_envelope():

tests/unit/parser/test_kinesis.py renamed to tests/unit/parser/_pydantic/test_kinesis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
extract_cloudwatch_logs_from_record,
1414
)
1515
from tests.functional.utils import load_event
16-
from tests.unit.parser.schemas import MyKinesisBusiness
16+
from tests.unit.parser._pydantic.schemas import MyKinesisBusiness
1717

1818

1919
def test_kinesis_trigger_bad_base64_event():

tests/unit/parser/test_kinesis_firehose.py renamed to tests/unit/parser/_pydantic/test_kinesis_firehose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
KinesisFirehoseSqsRecord,
1010
)
1111
from tests.functional.utils import load_event
12-
from tests.unit.parser.schemas import MyKinesisFirehoseBusiness
12+
from tests.unit.parser._pydantic.schemas import MyKinesisFirehoseBusiness
1313

1414

1515
def test_firehose_sqs_wrapped_message_event():

tests/unit/parser/test_lambda_function_url.py renamed to tests/unit/parser/_pydantic/test_lambda_function_url.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from aws_lambda_powertools.utilities.parser import envelopes, parse
22
from aws_lambda_powertools.utilities.parser.models import LambdaFunctionUrlModel
33
from tests.functional.utils import load_event
4-
from tests.unit.parser.schemas import MyALambdaFuncUrlBusiness
4+
from tests.unit.parser._pydantic.schemas import MyALambdaFuncUrlBusiness
55

66

77
def test_lambda_func_url_event_with_envelope():
File renamed without changes.

tests/unit/parser/test_sns.py renamed to tests/unit/parser/_pydantic/test_sns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from aws_lambda_powertools.utilities.parser import ValidationError, envelopes, parse
66
from tests.functional.utils import load_event
77
from tests.functional.validator.conftest import sns_event # noqa: F401
8-
from tests.unit.parser.schemas import MyAdvancedSnsBusiness, MySnsBusiness
8+
from tests.unit.parser._pydantic.schemas import MyAdvancedSnsBusiness, MySnsBusiness
99

1010

1111
def test_handle_sns_trigger_event_json_body(sns_event): # noqa: F811

tests/unit/parser/test_sqs.py renamed to tests/unit/parser/_pydantic/test_sqs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from aws_lambda_powertools.utilities.parser.models import SqsModel
55
from tests.functional.utils import load_event
66
from tests.functional.validator.conftest import sqs_event # noqa: F401
7-
from tests.unit.parser.schemas import MyAdvancedSqsBusiness, MySqsBusiness
7+
from tests.unit.parser._pydantic.schemas import MyAdvancedSqsBusiness, MySqsBusiness
88

99

1010
def test_handle_sqs_trigger_event_json_body(sqs_event): # noqa: F811

tests/unit/parser/test_vpc_lattice.py renamed to tests/unit/parser/_pydantic/test_vpc_lattice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from aws_lambda_powertools.utilities.parser import ValidationError, envelopes, parse
44
from aws_lambda_powertools.utilities.parser.models import VpcLatticeModel
55
from tests.functional.utils import load_event
6-
from tests.unit.parser.schemas import MyVpcLatticeBusiness
6+
from tests.unit.parser._pydantic.schemas import MyVpcLatticeBusiness
77

88

99
def test_vpc_lattice_event_with_envelope():

tests/unit/parser/test_vpc_latticev2.py renamed to tests/unit/parser/_pydantic/test_vpc_latticev2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from aws_lambda_powertools.utilities.parser import ValidationError, envelopes, parse
44
from aws_lambda_powertools.utilities.parser.models import VpcLatticeV2Model
55
from tests.functional.utils import load_event
6-
from tests.unit.parser.schemas import MyVpcLatticeBusiness
6+
from tests.unit.parser._pydantic.schemas import MyVpcLatticeBusiness
77

88

99
def test_vpc_lattice_v2_event_with_envelope():

0 commit comments

Comments
 (0)