2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
|
|
|
ID: issue-3389
|
|
|
|
ISSUE: 3389
|
|
|
|
TITLE: Add attachment's CHARACTER SET name into corresponding trace records
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-3008
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_3008
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
db = db_factory()
|
2021-11-16 19:44:53 +01:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
act = python_act('db', substitutions=[('^((?!ERROR|ELEMENT|SYSDBA:NONE).)*$', ''),
|
|
|
|
('.*SYSDBA:NONE', 'SYSDBA:NONE'), ('TCPV.*', 'TCP')])
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
SYSDBA:NONE, UTF8, TCP
|
|
|
|
SYSDBA:NONE, UTF8, TCP
|
|
|
|
SYSDBA:NONE, ISO88591, TCP
|
|
|
|
SYSDBA:NONE, ISO88591, TCP
|
2021-11-16 19:44:53 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
trace = ['log_connections = true',
|
2021-12-07 20:09:36 +01:00
|
|
|
'time_threshold = 0',
|
|
|
|
]
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2024-05-15 19:26:01 +02:00
|
|
|
@pytest.mark.trace
|
2021-11-16 19:44:53 +01:00
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-22 21:59:15 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
with act.trace(db_events=trace):
|
|
|
|
with act.db.connect(charset='utf8'):
|
2021-12-07 20:09:36 +01:00
|
|
|
pass
|
2022-01-22 21:59:15 +01:00
|
|
|
with act.db.connect(charset='iso8859_1'):
|
2021-12-07 20:09:36 +01:00
|
|
|
pass
|
2022-01-22 21:59:15 +01:00
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.trace_to_stdout(upper=True)
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|