File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/service-library/tests Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 33import logging
44
55import pytest
6-
7- from common_library .error_codes import create_error_code
6+ from common_library .error_codes import create_error_code , parse_error_code_parts
87from common_library .errors_classes import OsparcErrorMixin
98from servicelib .logging_errors import (
109 create_troubleshotting_log_kwargs ,
@@ -22,7 +21,11 @@ class MyError(OsparcErrorMixin, RuntimeError):
2221 exc = exc_info .value
2322 error_code = create_error_code (exc )
2423
25- assert exc .error_code () == error_code
24+ eoc1_fingerprint , eoc1_snapshot = parse_error_code_parts (error_code )
25+ eoc2_fingerprint , eoc2_snapshot = parse_error_code_parts (exc .error_code ())
26+
27+ assert eoc1_fingerprint == eoc2_fingerprint
28+ assert eoc1_snapshot <= eoc2_snapshot
2629
2730 msg = f"Nice message to user [{ error_code } ]"
2831
@@ -45,7 +48,7 @@ class MyError(OsparcErrorMixin, RuntimeError):
4548 assert log_kwargs ["extra" ] is not None
4649 assert (
4750 # pylint: disable=unsubscriptable-object
48- log_kwargs ["extra" ][ "log_uid" ]
51+ log_kwargs ["extra" ]. get ( "log_uid" )
4952 == "123"
5053 ), "user_id is injected as extra from context"
5154
You can’t perform that action at this time.
0 commit comments