MCPcopy Create free account
hub / github.com/authlib/authlib / test_invalid_request

Function test_invalid_request

tests/flask/test_oauth2/test_device_code_grant.py:116–136  ·  view source on GitHub ↗
(test_client)

Source from the content-addressed store, hash-verified

114
115
116def test_invalid_request(test_client):
117 rv = test_client.post(
118 "/oauth/token",
119 data={
120 "grant_type": DeviceCodeGrant.GRANT_TYPE,
121 "client_id": "test",
122 },
123 )
124 resp = json.loads(rv.data)
125 assert resp["error"] == "invalid_request"
126
127 rv = test_client.post(
128 "/oauth/token",
129 data={
130 "grant_type": DeviceCodeGrant.GRANT_TYPE,
131 "device_code": "missing",
132 "client_id": "client-id",
133 },
134 )
135 resp = json.loads(rv.data)
136 assert resp["error"] == "invalid_request"
137
138
139def test_unauthorized_client(test_client, db, client):

Callers

nothing calls this directly

Calls 1

postMethod · 0.80

Tested by

no test coverage detected