mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-27 16:26:40 +03:00
79713ef647
floats and integers can be replaced with each other jsonpath "$.count" equals 5 jsonpath "$.count" equals 5.0
28 lines
564 B
Python
28 lines
564 B
Python
from tests import app
|
|
from flask import Response
|
|
|
|
@app.route("/assert-json")
|
|
def assert_json():
|
|
return Response('''{
|
|
"count": 5,
|
|
"success": false,
|
|
"errors": [{"id":"error1"},{"id":"error2"}],
|
|
"warnings": [],
|
|
"duration": 1.5,
|
|
"tags": ["test"],
|
|
"nullable": null
|
|
}''', mimetype='application/json')
|
|
|
|
|
|
@app.route("/assert-json/index")
|
|
def assert_json_index():
|
|
return "1"
|
|
|
|
@app.route("/assert-json/list")
|
|
def assert_json_list():
|
|
return Response('''[
|
|
{ "id": 1, "name": "Bob"},
|
|
{ "id": 2, "name": "Bill"}
|
|
]''', mimetype='application/json')
|
|
|