6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_2431_test.py

57 lines
1.4 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-21 18:49:26 +01:00
"""
ID: issue-2847
ISSUE: 2847
TITLE: String values in error messages are not converted to connection charset
DESCRIPTION:
JIRA: CORE-2431
FBTEST: bugs.core_2431
2022-01-21 18:49:26 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
db = db_factory(from_backup='core2431.fbk')
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set list on;
select c.rdb$character_set_name as connection_cset
from mon$attachments a
join rdb$character_sets c on a.mon$character_set_id = c.rdb$character_set_id
where a.mon$attachment_id = current_connection;
set term ^;
execute block as
begin
exception ex_bad_remainder using (-8);
end
^
set term ;^
commit;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
act = isql_act('db', test_script,
substitutions=[('-At block line: [\\d]+, col: [\\d]+', '-At block line')])
2021-04-26 20:07:00 +02:00
2022-01-21 18:49:26 +01:00
expected_stdout = """
2021-12-19 22:25:36 +01:00
CONNECTION_CSET WIN1251
2021-12-22 20:23:11 +01:00
"""
2022-01-21 18:49:26 +01:00
expected_stderr = """
2021-04-26 20:07:00 +02:00
Statement failed, SQLSTATE = HY000
exception 1
-EX_BAD_REMAINDER
-Новый остаток изделия будет отрицательным: -8
-At block line: 3, col: 7
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-21 18:49:26 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.expected_stderr = expected_stderr
act.execute(charset='win1251')
assert (act.clean_stderr == act.clean_expected_stderr and
act.clean_stdout == act.clean_expected_stdout)
2021-04-26 20:07:00 +02:00