6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\bugs\core_4440_test.py: Added 'Error reading/writing' in substitutions: messages caused by crash must not be suppressed. Added 'combine_output = True' in order to see SQLSTATE if any error occurs.

This commit is contained in:
pavel-zotov 2023-12-12 20:36:50 +03:00
parent 00a1a15b7d
commit 3de5c4145d

View File

@ -3,10 +3,15 @@
"""
ID: issue-4760
ISSUE: 4760
TITLE: isql crash without connect when execute command "show version"
TITLE: ISQL crashed without connect when execute command "show version"
DESCRIPTION:
JIRA: CORE-4440
FBTEST: bugs.core_4440
NOTES:
[12.12.2023] pzotov
Added 'Error reading/writing' in substitutions: runtime error must not be filtered out by '?!(...)' pattern
("negative lookahead assertion", see https://docs.python.org/3/library/re.html#regular-expression-syntax).
Added 'combine_output = True' in order to see message related to any error.
"""
import pytest
@ -17,18 +22,16 @@ db = db_factory()
test_script = """
show version;
set list on;
select current_user from rdb$database;
select current_user as whoami from rdb$database;
"""
act = isql_act('db', test_script, substitutions=[('^((?!SYSDBA).)*$', '')])
expected_stdout = """
USER SYSDBA
"""
act = isql_act('db', test_script, substitutions = [ ('[ \t]+', ' '), ('^((?!SQLSTATE|(Error\\s+(reading|writing))|WHOAMI).)*$', '') ] )
@pytest.mark.version('>=3.0')
def test_1(act: Action):
expected_stdout = f"""
WHOAMI {act.db.user.upper()}
"""
act.expected_stdout = expected_stdout
act.execute()
act.execute(combine_output = True)
assert act.clean_stdout == act.clean_expected_stdout