コード例 #1
0
 def test_valid_input_handler(self):
     handler.lambda_handler(create_sqs_event(get_test_order()), None)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 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)
コード例 #5
0
 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)
コード例 #6
0
 def test_lambda_handler_powertools(self):
     powertools_handler.lambda_handler(create_sqs_event(get_test_order()), None)