2021-12-30 19:43:52 +01:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
"""
|
|
|
|
ID: issue-6786
|
|
|
|
ISSUE: 6786
|
|
|
|
TITLE: Add session time zone to system context
|
|
|
|
DESCRIPTION:
|
|
|
|
Test checks only presence of not-null context variable in the 'SYSTEM' namespace,
|
|
|
|
without verifying its value (obviously, it can vary on different machines).
|
|
|
|
Name of context variable: 'SESSION_TIMEZONE'.
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.gh_6786
|
2022-01-27 20:08:36 +01:00
|
|
|
"""
|
2021-12-30 19:43:52 +01:00
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-12-30 19:43:52 +01:00
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
db = db_factory()
|
2021-12-30 19:43:52 +01:00
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
test_script = """
|
2021-12-30 19:43:52 +01:00
|
|
|
set list on;
|
|
|
|
select iif(rdb$get_context('SYSTEM','SESSION_TIMEZONE') is not null, 'Defined.','UNDEFINED,') as session_tz from rdb$database;
|
|
|
|
"""
|
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
|
2021-12-30 19:43:52 +01:00
|
|
|
|
2022-01-27 20:08:36 +01:00
|
|
|
expected_stdout = """
|
2021-12-30 19:43:52 +01:00
|
|
|
SESSION_TZ Defined.
|
|
|
|
"""
|
|
|
|
|
|
|
|
@pytest.mark.version('>=4.0')
|
2022-01-27 20:08:36 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.execute()
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|