6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00

Added/Updated functional\tabloid\test_eqc_136030.py: Checked on: 3.0.8.33535, 4.0.1.2692, 5.0.0.497

This commit is contained in:
zotov 2022-05-26 11:48:56 +03:00
parent 5da35c2d91
commit 0d62d4ce41

View File

@ -5,17 +5,21 @@ ID: tabloid.eqc-136030
TITLE: Check ability for preparing and then run query with parameters. Query should use ORDER-BY clause. TITLE: Check ability for preparing and then run query with parameters. Query should use ORDER-BY clause.
DESCRIPTION: DESCRIPTION:
NOTES: NOTES:
[02.02.2019] [02.02.2019] pzotov
removed from DB metadata calls to UDFs - they are not used in this test but can not be used in FB 4.0 by default. removed from DB metadata calls to UDFs - they are not used in this test but can not be used in FB 4.0 by default.
Removed triggers because they have no deal here. Removed triggers because they have no deal here.
Checked on: [26.05.2022] pzotov
3.0.5.33097: OK, 2.782s. Re-implemented for work in firebird-qa suite.
4.0.0.1421: OK, 3.642s. Checked on: 3.0.8.33535, 4.0.1.2692, 5.0.0.497
FBTEST: functional.tabloid.eqc_136030 FBTEST: functional.tabloid.eqc_136030
""" """
import pytest import pytest
import zipfile
from pathlib import Path
from firebird.qa import * from firebird.qa import *
from firebird.driver import SrvRestoreFlag
db = db_factory() db = db_factory()
@ -305,68 +309,55 @@ expected_stdout = """
FBLC <null> FBLC <null>
""" """
@pytest.mark.skip('FIXME: Not IMPLEMENTED') fbk_file = temp_file('tmp_eqc_136030.fbk')
@pytest.mark.version('>=3.0')
def test_1(act: Action):
pytest.fail("Not IMPLEMENTED")
# Original python code for this test: @pytest.mark.version('>=3.0')
# ----------------------------------- def test_1(act: Action, fbk_file: Path, capsys):
# import os zipped_fbk_file = zipfile.Path(act.files_dir / 'eqc136030.zip', at='eqc136030.fbk')
# import zipfile fbk_file.write_bytes(zipped_fbk_file.read_bytes())
# with act.connect_server() as srv:
# os.environ["ISC_USER"] = 'SYSDBA' srv.database.restore(database=act.db.db_path, backup=fbk_file, flags=SrvRestoreFlag.REPLACE)
# os.environ["ISC_PASSWORD"] = 'masterkey' srv.wait()
#
# db_conn.close() script = """
# zf = zipfile.ZipFile( os.path.join(context['files_location'],'eqc136030.zip') ) set list on;
# zf.extractall( context['temp_directory'] ) set sqlda_display on;
# zf.close() set planonly;
#
# fbk = os.path.join(context['temp_directory'],'eqc136030.fbk') select
# a.csoc, a.nreserc , a.coddoc , a.codgio ,
# runProgram('gbak',['-rep',fbk, dsn]) a.macchina, a.rec_upd, a.utente_upd,
# cast(a.fblc as integer) fblc,
# script=""" cast(a.fdel as integer) fdel,
# set list on; b.tipdoc, b.desdoc, b.fblc , c.tipgio, c.desgio , c.fblc
# set sqlda_display on; from docgio a
# set planonly; left join doctip (a.csoc, a.nreserc) b on ( a.coddoc = b.coddoc )
# left join giotip (a.csoc, a.nreserc) c on (a.codgio = c.codgio)
# select where
# a.csoc, a.nreserc , a.coddoc , a.codgio , a.csoc = ?
# a.macchina, a.rec_upd, a.utente_upd, and a.nreserc = ?
# cast(a.fblc as integer) fblc, order by a.codgio, a.coddoc;
# cast(a.fdel as integer) fdel,
# b.tipdoc, b.desdoc, b.fblc , c.tipgio, c.desgio , c.fblc set planonly;
# from docgio a set plan off;
# left join doctip (a.csoc, a.nreserc) b on ( a.coddoc = b.coddoc ) set sqlda_display off;
# left join giotip (a.csoc, a.nreserc) c on (a.codgio = c.codgio)
# where select
# a.csoc = ? a.csoc, a.nreserc , a.coddoc , a.codgio ,
# and a.nreserc = ? a.macchina, a.rec_upd, a.utente_upd,
# order by a.codgio, a.coddoc; cast(a.fblc as integer) fblc,
# cast(a.fdel as integer) fdel,
# set planonly; b.tipdoc, b.desdoc, b.fblc , c.tipgio, c.desgio , c.fblc
# set plan off; from docgio a
# set sqlda_display off; left join doctip (a.csoc, a.nreserc) b on ( a.coddoc = b.coddoc )
# left join giotip (a.csoc, a.nreserc) c on (a.codgio = c.codgio)
# select where
# a.csoc, a.nreserc , a.coddoc , a.codgio , a.csoc = 'DEM1' -- :csoc
# a.macchina, a.rec_upd, a.utente_upd, and a.nreserc = '' -- :nreserc
# cast(a.fblc as integer) fblc, order by a.codgio, a.coddoc;
# cast(a.fdel as integer) fdel, """
# b.tipdoc, b.desdoc, b.fblc , c.tipgio, c.desgio , c.fblc
# from docgio a act.expected_stdout = expected_stdout
# left join doctip (a.csoc, a.nreserc) b on ( a.coddoc = b.coddoc ) act.isql(switches=[], input = script, combine_output=True)
# left join giotip (a.csoc, a.nreserc) c on (a.codgio = c.codgio)
# where assert act.clean_stdout == act.clean_expected_stdout
# a.csoc = 'DEM1' -- :csoc
# and a.nreserc = '' -- :nreserc
# order by a.codgio, a.coddoc;
# """
# runProgram('isql',[dsn,'-q'],script)
#
# ###############################
# # Cleanup.
# os.remove(fbk)
# -----------------------------------