Projet

Général

Profil

0001-oidc-authn-include-a-status-code-in-httmock-response.patch

Paul Marillonnet, 24 avril 2019 15:16

Télécharger (1,78 ko)

Voir les différences:

Subject: [PATCH] oidc authn: include a status code in httmock responses

 tests/test_auth_oidc.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tests/test_auth_oidc.py
208 208
                'headers': {
209 209
                    'content-type': 'application/json',
210 210
                },
211
                'status_code': 200,
211 212
            }
212 213
        else:
213 214
            return {
......
215 216
                'headers': {
216 217
                    'content-type': 'application/json',
217 218
                },
218
                'status': 400,
219
                'status_code': 400,
219 220
            }
220 221

  
221 222
    @urlmatch(netloc=userinfo_endpoint.netloc, path=userinfo_endpoint.path)
......
234 235
            'headers': {
235 236
                'content-type': 'application/json',
236 237
            },
238
            'status_code': 200,
237 239
        }
238 240

  
239 241
    @urlmatch(netloc=token_revocation_endpoint.netloc, path=token_revocation_endpoint.path)
240 242
    def token_revocation_endpoint_mock(url, request):
241 243
        query = urlparse.parse_qs(request.body)
242 244
        assert 'token' in query
243
        return {}
245
        return {
246
            'status_code': 200,
247
        }
244 248
    return HTTMock(token_endpoint_mock, user_info_endpoint_mock, token_revocation_endpoint_mock)
245 249

  
246 250

  
247
-