def test_valid_input_handler(self): handler.lambda_handler(create_sqs_event(get_test_order()), None)
def test_missing_item_property(self): malformed_order = get_test_order() malformed_order['items'][0] = {"foo": "bar"} with pytest.raises(ValueError): handler.lambda_handler(create_sqs_event(malformed_order), None)
def test_invalid_item_type(self): malformed_order = get_test_order() malformed_order['items'][0]['type'] = "foo" with pytest.raises(ValueError): handler.lambda_handler(create_sqs_event(malformed_order), None)
def test_negative_quantity_input(self): malformed_order = get_test_order() malformed_order['items'][0]['quantity'] = -8 with pytest.raises(ValueError): handler.lambda_handler(create_sqs_event(malformed_order), None)
def test_missing_item_property(self): malformed_order = get_test_order() malformed_order['items'][0] = None with pytest.raises(ValidationError): powertools_handler.lambda_handler(create_sqs_event(malformed_order), None)
def test_lambda_handler_powertools(self): powertools_handler.lambda_handler(create_sqs_event(get_test_order()), None)