Exemplo n.º 1
0
def get_shop_list():
    query = request.args.get("range")
    if query is not None:
        error_code = shoplist.check_query(query=query)
        if error_code is not None:
            return jsonify({
                "result": [],
                "message": errorcode.ERROR_CODE[error_code]
            })
        return jsonify({"result": shoplist.get_range(query=query)})
    else:
        return jsonify({"result": shoplist.get_all()})
Exemplo n.º 2
0
def test_check_query01():
    result = shoplist.check_query("1-5")
    assert result is None
Exemplo n.º 3
0
def test_check_query05():
    result = shoplist.check_query("Hoge")
    assert result == "E002"
Exemplo n.º 4
0
def test_check_query04():
    result = shoplist.check_query("9-7")
    assert result == "E001"
Exemplo n.º 5
0
def test_check_query02():
    result = shoplist.check_query("0-1")
    assert result is None