forked from TrueCloudLab/frostfs-testlib
Move errors patterns and check functions to testlib
Signed-off-by: Aleksei Chetaev <alex.chetaev@gmail.com>
This commit is contained in:
parent
e891f3804c
commit
44e9a8480a
3 changed files with 47 additions and 0 deletions
11
src/frostfs_testlib/utils/errors.py
Normal file
11
src/frostfs_testlib/utils/errors.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
import re
|
||||
|
||||
|
||||
def error_matches_status(error: Exception, status_pattern: str) -> bool:
|
||||
"""
|
||||
Determines whether exception matches specified status pattern.
|
||||
|
||||
We use re.search() to be consistent with pytest.raises.
|
||||
"""
|
||||
match = re.search(status_pattern, str(error))
|
||||
return match is not None
|
Loading…
Add table
Add a link
Reference in a new issue