2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
2022-01-23 20:41:55 +01:00
|
|
|
|
|
|
|
"""
|
|
|
|
ID: issue-4447
|
|
|
|
ISSUE: 4447
|
|
|
|
TITLE: Metadata source becomes wrong after twice transliteration to the metadata charset
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-4119
|
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
import pytest
|
2021-11-18 20:15:37 +01:00
|
|
|
from pathlib import Path
|
2022-01-23 20:41:55 +01:00
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
db = db_factory(charset='WIN1251')
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
act = python_act('db', substitutions=[('=.*', '')])
|
|
|
|
script_file = temp_file('test_script.sql')
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-23 20:41:55 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
Procedure text:
|
|
|
|
=============================================================================
|
|
|
|
begin
|
|
|
|
-- Моя процедура
|
|
|
|
end
|
|
|
|
=============================================================================
|
2021-11-18 20:15:37 +01:00
|
|
|
"""
|
|
|
|
|
2021-04-26 20:07:00 +02:00
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-23 20:41:55 +01:00
|
|
|
def test_1(act: Action, script_file: Path):
|
|
|
|
script_file.write_text("""
|
2021-11-18 20:15:37 +01:00
|
|
|
set term ^;
|
|
|
|
create procedure myproc as
|
|
|
|
begin
|
|
|
|
-- Моя процедура
|
|
|
|
end^
|
|
|
|
set term ;^
|
|
|
|
show procedure myproc;
|
2022-01-23 20:41:55 +01:00
|
|
|
""", encoding='cp1251')
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.isql(switches=['-q'], input_file=script_file, charset='WIN1251')
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
|