예제 #1
0
def test_process_orders_input_error():
    error_output = {
        "message": "error while processing order: string indices must be integers",
        "status": "error",
    }
    assert (
        process_orders({"order_code": "ORD1", "order_details": {"VS5": "11"}})
        == error_output
    )
예제 #2
0
def test_process_orders_input_invalid():
    error_output = {
        "message": "error while processing order: key not found - 'order_details'",
        "status": "error",
    }
    assert process_orders(SAMPLE_ORDER_INVALID_INPUT) == error_output
예제 #3
0
def test_process_orders_input_empty():
    error_output = {
        "message": "please provide order in proper format",
        "status": "error",
    }
    assert process_orders([]) == error_output
예제 #4
0
def test_process_orders():
    assert process_orders(SAMPLE_ORDER_INPUT) == SAMPLE_ORDER_OUTPUT