diff --git a/tests/infrastructure/test_cdk.py b/tests/infrastructure/test_cdk.py index 7b676072..d2242c89 100644 --- a/tests/infrastructure/test_cdk.py +++ b/tests/infrastructure/test_cdk.py @@ -14,3 +14,4 @@ def test_synthesizes_properly(): # verify that we have one API GW, that is it not deleted by mistake template.resource_count_is('AWS::ApiGateway::RestApi', 1) + template.resource_count_is('AWS::DynamoDB::Table', 1) diff --git a/tests/integration/test_create_order.py b/tests/integration/test_create_order.py index cae51461..23241271 100644 --- a/tests/integration/test_create_order.py +++ b/tests/integration/test_create_order.py @@ -47,7 +47,8 @@ def mock_exception_dynamic_configuration(mocker) -> None: def test_handler_200_ok(mocker, table_name: str): mock_dynamic_configuration(mocker, MOCKED_SCHEMA) customer_name = 'RanTheBuilder' - body = Input(customer_name=customer_name, order_item_count=5, tier='premium') + order_item_count = 5 + body = Input(customer_name=customer_name, order_item_count=order_item_count, tier='premium') response = create_order(generate_api_gw_event(body.dict()), generate_context()) # assert response assert response['statusCode'] == HTTPStatus.OK @@ -60,6 +61,7 @@ def test_handler_200_ok(mocker, table_name: str): response = dynamodb_table.get_item(Key={'order_id': body_dict['order_id']}) assert 'Item' in response # order was found assert response['Item']['customer_name'] == customer_name + assert response['Item']['count'] == order_item_count def test_internal_server_error(mocker):