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

Function test_jsonify_dicts

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

Source from the content-addressed store, hash-verified

76
77
78def test_jsonify_dicts(app, client):
79 d = {
80 "a": 0,
81 "b": 23,
82 "c": 3.14,
83 "d": "t",
84 "e": "Hi",
85 "f": True,
86 "g": False,
87 "h": ["test list", 10, False],
88 "i": {"test": "dict"},
89 }
90
91 @app.route("/kw")
92 def return_kwargs():
93 return flask.jsonify(**d)
94
95 @app.route("/dict")
96 def return_dict():
97 return flask.jsonify(d)
98
99 for url in "/kw", "/dict":
100 rv = client.get(url)
101 assert rv.mimetype == "application/json"
102 assert flask.json.loads(rv.data) == d
103
104
105def test_jsonify_arrays(app, client):

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected