|
1 | 1 | # pylint: disable=unused-variable |
2 | 2 | # pylint: disable=unused-argument |
3 | 3 | # pylint: disable=redefined-outer-name |
4 | | - |
| 4 | +# pylint: disable=too-many-arguments |
5 | 5 |
|
6 | 6 | from http import HTTPStatus |
7 | 7 | from uuid import UUID |
|
25 | 25 |
|
26 | 26 | async def test_backend_service_exception_mapper(): |
27 | 27 | @service_exception_mapper( |
28 | | - "DummyService", |
29 | | - {status.HTTP_400_BAD_REQUEST: ProfileNotFoundError}, |
| 28 | + service_name="DummyService", |
| 29 | + http_status_map={status.HTTP_400_BAD_REQUEST: ProfileNotFoundError}, |
30 | 30 | ) |
31 | 31 | async def my_endpoint(status_code: int): |
32 | 32 | raise HTTPStatusError( |
@@ -103,26 +103,26 @@ async def coro1(project_id): |
103 | 103 | pass |
104 | 104 |
|
105 | 105 | with pytest.raises(AssertionError): |
106 | | - _assert_correct_kwargs(func=coro1, status_map=status_map) |
| 106 | + _assert_correct_kwargs(func=coro1, exception_types=set(status_map.values())) |
107 | 107 |
|
108 | 108 | async def coro2(project_id=UUID("9c201eb7-ba04-4d9b-abe6-f16b406ca86d")): |
109 | 109 | pass |
110 | 110 |
|
111 | 111 | with pytest.raises(AssertionError) as exc: |
112 | | - _assert_correct_kwargs(func=coro2, status_map=status_map) |
| 112 | + _assert_correct_kwargs(func=coro2, exception_types=set(status_map.values())) |
113 | 113 |
|
114 | 114 | async def coro3(*, project_id): |
115 | 115 | pass |
116 | 116 |
|
117 | | - _assert_correct_kwargs(func=coro3, status_map=status_map) |
| 117 | + _assert_correct_kwargs(func=coro3, exception_types=set(status_map.values())) |
118 | 118 |
|
119 | 119 | async def coro4(*, project_id=UUID("ce56af2e-e9e5-46a4-8067-662077de5528")): |
120 | 120 | pass |
121 | 121 |
|
122 | | - _assert_correct_kwargs(func=coro4, status_map=status_map) |
| 122 | + _assert_correct_kwargs(func=coro4, exception_types=set(status_map.values())) |
123 | 123 |
|
124 | 124 | async def coro5(*, project_uuid): |
125 | 125 | pass |
126 | 126 |
|
127 | 127 | with pytest.raises(AssertionError): |
128 | | - _assert_correct_kwargs(func=coro5, status_map=status_map) |
| 128 | + _assert_correct_kwargs(func=coro5, exception_types=set(status_map.values())) |
0 commit comments