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

Added/Updated tests\bugs\gh_7604_test.py: moved DDL with non-ascii text into 'init_sql' to be executed on initial phase, otherwise get exception UnicodeEncodeError: 'charmap' codec can not encode characters in position 208-211: character maps to [undefined].

This commit is contained in:
pavel-zotov 2023-06-04 10:22:26 +03:00
parent 80521671ee
commit 305dc3318c

View File

@ -13,7 +13,19 @@ import locale
import pytest
from firebird.qa import *
db = db_factory(charset = 'utf8')
init_sql = """
set term ^;
create or alter function sp_test_func returns blob sub_type text character set utf8 as
declare runtotal blob sub_type text;
begin
runtotal = 'мама мыла раму';
return runtotal;
end
^
set term ;^
commit;
"""
db = db_factory(charset = 'utf8', init = init_sql)
act = python_act('db', substitutions=[('^((?!sqltype:).)*$',''),('[ \t]+',' '),('.*alias:.*','')])
@ -21,16 +33,6 @@ act = python_act('db', substitutions=[('^((?!sqltype:).)*$',''),('[ \t]+',' '),(
def test_1(act: Action):
test_sql = """
set term ^;
create or alter function sp_test_func returns blob sub_type text character set utf8 as
declare runtotal blob sub_type text;
begin
runtotal = 'мама мыла раму';
return runtotal;
end
^
set term ;^
commit;
set list on;
set sqlda_display on;
select sp_test_func() as runtotal from rdb$database rows 0;