|
1 | 1 | # Copyright (c) Microsoft Corporation. All rights reserved.
|
2 | 2 | # Licensed under the MIT License.
|
3 | 3 | import uuid
|
| 4 | +from http import HTTPStatus |
4 | 5 | from typing import Callable, Union
|
5 | 6 | from unittest.mock import Mock
|
6 | 7 |
|
@@ -233,9 +234,9 @@ async def test_should_intercept_oauth_cards_for_sso(self):
|
233 | 234 | async def post_return():
|
234 | 235 | nonlocal sequence
|
235 | 236 | if sequence == 0:
|
236 |
| - result = InvokeResponse(body=first_response, status=200) |
| 237 | + result = InvokeResponse(body=first_response, status=HTTPStatus.OK) |
237 | 238 | else:
|
238 |
| - result = InvokeResponse(status=200) |
| 239 | + result = InvokeResponse(status=HTTPStatus.OK) |
239 | 240 | sequence += 1
|
240 | 241 | return result
|
241 | 242 |
|
@@ -277,9 +278,9 @@ async def test_should_not_intercept_oauth_cards_for_empty_connection_name(self):
|
277 | 278 | async def post_return():
|
278 | 279 | nonlocal sequence
|
279 | 280 | if sequence == 0:
|
280 |
| - result = InvokeResponse(body=first_response, status=200) |
| 281 | + result = InvokeResponse(body=first_response, status=HTTPStatus.OK) |
281 | 282 | else:
|
282 |
| - result = InvokeResponse(status=200) |
| 283 | + result = InvokeResponse(status=HTTPStatus.OK) |
283 | 284 | sequence += 1
|
284 | 285 | return result
|
285 | 286 |
|
@@ -319,9 +320,9 @@ async def test_should_not_intercept_oauth_cards_for_empty_token(self):
|
319 | 320 | async def post_return():
|
320 | 321 | nonlocal sequence
|
321 | 322 | if sequence == 0:
|
322 |
| - result = InvokeResponse(body=first_response, status=200) |
| 323 | + result = InvokeResponse(body=first_response, status=HTTPStatus.OK) |
323 | 324 | else:
|
324 |
| - result = InvokeResponse(status=200) |
| 325 | + result = InvokeResponse(status=HTTPStatus.OK) |
325 | 326 | sequence += 1
|
326 | 327 | return result
|
327 | 328 |
|
@@ -360,9 +361,9 @@ async def test_should_not_intercept_oauth_cards_for_token_exception(self):
|
360 | 361 | async def post_return():
|
361 | 362 | nonlocal sequence
|
362 | 363 | if sequence == 0:
|
363 |
| - result = InvokeResponse(body=first_response, status=200) |
| 364 | + result = InvokeResponse(body=first_response, status=HTTPStatus.OK) |
364 | 365 | else:
|
365 |
| - result = InvokeResponse(status=200) |
| 366 | + result = InvokeResponse(status=HTTPStatus.OK) |
366 | 367 | sequence += 1
|
367 | 368 | return result
|
368 | 369 |
|
@@ -402,9 +403,9 @@ async def test_should_not_intercept_oauth_cards_for_bad_request(self):
|
402 | 403 | async def post_return():
|
403 | 404 | nonlocal sequence
|
404 | 405 | if sequence == 0:
|
405 |
| - result = InvokeResponse(body=first_response, status=200) |
| 406 | + result = InvokeResponse(body=first_response, status=HTTPStatus.OK) |
406 | 407 | else:
|
407 |
| - result = InvokeResponse(status=409) |
| 408 | + result = InvokeResponse(status=HTTPStatus.CONFLICT) |
408 | 409 | sequence += 1
|
409 | 410 | return result
|
410 | 411 |
|
|
0 commit comments