Skip to content

Commit bb55f64

Browse files
committed
fixes test
1 parent 5e97f4b commit bb55f64

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

packages/service-library/src/servicelib/aiohttp/rest_middlewares.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from .typing_extension import Handler, Middleware
2525

2626
DEFAULT_API_VERSION = "v0"
27-
_FMSG_INTERNAL_ERROR_USER_FRIENDLY_WITH_OEC = (
27+
_FMSG_INTERNAL_ERROR_USER_FRIENDLY = (
2828
"We apologize for the inconvenience. "
2929
"The issue has been recorded, please report it if it persists."
3030
)
@@ -51,7 +51,7 @@ def _process_and_raise_unexpected_error(request: web.BaseRequest, err: Exception
5151
"request.path": f"{request.path}",
5252
}
5353

54-
user_error_msg = _FMSG_INTERNAL_ERROR_USER_FRIENDLY_WITH_OEC.format(
54+
user_error_msg = _FMSG_INTERNAL_ERROR_USER_FRIENDLY.format(
5555
error_code=error_code
5656
)
5757
http_error = create_http_error(

packages/service-library/tests/aiohttp/test_rest_middlewares.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
import pytest
1414
from aiohttp import web
1515
from aiohttp.test_utils import TestClient
16-
from common_library.error_codes import parse_error_codes
1716
from common_library.json_serialization import json_dumps
1817
from servicelib.aiohttp import status
1918
from servicelib.aiohttp.rest_middlewares import (
20-
_FMSG_INTERNAL_ERROR_USER_FRIENDLY_WITH_OEC,
2119
envelope_middleware_factory,
2220
error_middleware_factory,
2321
)
@@ -234,14 +232,6 @@ async def test_raised_unhandled_exception(
234232
assert not data
235233
assert error
236234

237-
# user friendly message with OEC reference
238-
assert "OEC" in error["message"]
239-
parsed_oec = parse_error_codes(error["message"]).pop()
240-
assert (
241-
_FMSG_INTERNAL_ERROR_USER_FRIENDLY_WITH_OEC.format(error_code=parsed_oec)
242-
== error["message"]
243-
)
244-
245235
# avoids details
246236
assert not error.get("errors")
247237
assert not error.get("logs")

0 commit comments

Comments
 (0)