6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 14:03:06 +01:00
firebird-qa/tests/functional/gtcs/test_computed_fields_12.py

57 lines
1.7 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
# id: functional.gtcs.computed_fields_12
# title: computed-fields-12
# decription:
# Original test see in:
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/CF_ISQL_12.script
# SQL script for creating test database ('gtcs_sp1.fbk') and fill it with some data:
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/PROCS_QA_INIT_ISQL.script
# Checked on: 4.0.0.1803 SS; 3.0.6.33265 SS; 2.5.9.27149 SC.
#
# tracker_id:
# min_versions: ['2.5.0']
# versions: 2.5
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5
# resources: None
substitutions_1 = [('[ \t]+', ' ')]
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
test_script_1 = """
set heading off;
set list on;
/*---------------------------------------------*/
/* Computed field using another computed field */
/*---------------------------------------------*/
create table t3 (a integer, af computed by (a*3), afaf computed by (af*2));
insert into t3(a) values(10);
set count on;
select * from t3;
"""
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
expected_stdout_1 = """
A 10
AF 30
AFAF 60
Records affected: 1
"""
@pytest.mark.version('>=2.5')
def test_computed_fields_12_1(act_1: Action):
act_1.expected_stdout = expected_stdout_1
act_1.execute()
assert act_1.clean_expected_stdout == act_1.clean_stdout