MCPcopy
hub / github.com/pallets/flask / test_json_attr

Function test_json_attr

tests/test_json.py:196–207  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

194
195
196def test_json_attr(app, client):
197 @app.route("/add", methods=["POST"])
198 def add():
199 json = flask.request.get_json()
200 return str(json["a"] + json["b"])
201
202 rv = client.post(
203 "/add",
204 data=flask.json.dumps({"a": 1, "b": 2}),
205 content_type="application/json",
206 )
207 assert rv.data == b"3"
208
209
210def test_tojson_filter(app, req_ctx):

Callers

nothing calls this directly

Calls 2

postMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected