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_0986_test.py: minor changes: removed not working comments

This commit is contained in:
pavel-zotov 2024-09-04 12:43:07 +03:00
parent 21b75e0a26
commit 75230e4181

View File

@ -23,18 +23,18 @@ act = python_act('db', substitutions=[('in file .*', 'in file XXX')])
expected_stdout_a = """create collation "Циферки" for utf8 from unicode case insensitive 'NUMERIC-SORT=1';"""
expected_stderr_a_40 = """
Statement failed, SQLSTATE = 22018
arithmetic exception, numeric overflow, or string truncation
-Cannot transliterate character between character sets
After line 4 in file non_ascii_ddl.sql
Statement failed, SQLSTATE = 22018
arithmetic exception, numeric overflow, or string truncation
-Cannot transliterate character between character sets
After line 4 in file non_ascii_ddl.sql
"""
expected_stderr_a_30 = """
Statement failed, SQLSTATE = 22000
unsuccessful metadata update
-CREATE COLLATION Циферки failed
-Malformed string
After line 4 in file non_ascii_ddl.sql
Statement failed, SQLSTATE = 22000
unsuccessful metadata update
-CREATE COLLATION Циферки failed
-Malformed string
After line 4 in file non_ascii_ddl.sql
"""
non_ascii_ddl='''
@ -171,8 +171,6 @@ non_ascii_ddl='''
';
--------------------------------------------------
commit;
--/*
--TEMPLY COMMENTED UNTIL CORE-5221 IS OPEN:
set echo on;
show collation;
show domain;
@ -183,25 +181,28 @@ non_ascii_ddl='''
show view;
show procedure;
show role;
--*/
set list on;
set echo off;
select 'Metadata created OK.' as msg from rdb$database;
'''
tmp_file = temp_file('non_ascii_ddl.sql')
tmp_file = temp_file('tmp_0986_non_ascii_ddl.sql')
@pytest.mark.version('>=3.0')
def test_1(act: Action, tmp_file: Path):
tmp_file.write_bytes(non_ascii_ddl.encode('cp1251'))
# run without specifying charset
################################
act.expected_stdout = expected_stdout_a
act.expected_stderr = expected_stderr_a_40 if act.is_version('>=4.0') else expected_stderr_a_30
act.isql(switches=['-q'], input_file=tmp_file, charset=None, io_enc='cp1251')
assert (act.clean_stdout == act.clean_expected_stdout and
act.clean_stderr == act.clean_expected_stderr)
# run with charset
# run _with_ charset
####################
act.reset()
act.isql(switches=['-q'], input_file=tmp_file, charset='win1251', io_enc='cp1251')
assert act.clean_stdout.endswith('Metadata created OK.')