fetched mlz version

- before some chamges in the gerrit pipline

Change-Id: I33eb2d75f83345a7039d0fb709e66defefb1c3e0
This commit is contained in:
2023-05-02 11:31:30 +02:00
parent b19a8c2e5c
commit da15df076a
765 changed files with 35890 additions and 59302 deletions

View File

@ -21,10 +21,28 @@
# *****************************************************************************
"""test data types."""
import secop.errors
import pytest
from frappy.errors import RangeError, WrongTypeError, ProgrammingError, \
ConfigError, InternalError, TimeoutSECoPError, secop_error, make_secop_error
def test_errors():
"""check consistence of secop.errors.EXCEPTIONS"""
for e in secop.errors.EXCEPTIONS.values():
assert secop.errors.EXCEPTIONS[e().name] == e
@pytest.mark.parametrize('exc, name, text, echk', [
(RangeError('out of range'), 'RangeError', 'out of range', None),
(WrongTypeError('bad type'), 'WrongType', 'bad type', None),
(ProgrammingError('x'), 'InternalError', 'ProgrammingError: x', None),
(ConfigError('y'), 'InternalError', 'ConfigError: y', None),
(InternalError('z'), 'InternalError', 'z', None),
(TimeoutSECoPError('t'), 'TimeoutError', 't', None),
(ValueError('v'), 'InternalError', "ValueError: v", InternalError("ValueError: v")),
(None, 'InternalError', "UnknownError: v", InternalError("UnknownError: v")),
])
def test_errors(exc, name, text, echk):
"""check consistence of frappy.errors"""
if exc:
err = secop_error(exc)
assert err.name == name
assert str(err) == text
recheck = make_secop_error(name, text)
echk = echk or exc
assert type(recheck) == type(echk)
assert str(recheck) == str(echk)