6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-02-02 02:40:42 +01:00

Added/Updated functional\gtcs\test_ref_integ_inactive_pk_index_2.py: checked on 4.0.1.2692, 3.0.8.33535

This commit is contained in:
zotov 2022-04-28 20:42:08 +03:00
parent 58858d8c97
commit ed55644aa1

View File

@ -17,6 +17,7 @@ DESCRIPTION:
FBTEST: functional.gtcs.ref_integ_inactive_pk_index_2
"""
import os
import pytest
from firebird.qa import *
@ -24,7 +25,7 @@ db = db_factory()
act = python_act('db')
expected_stderr = """
test_expected_stderr = """
Statement failed, SQLSTATE = 27000
unsuccessful metadata update
-ALTER INDEX DEPT_KEY failed
@ -34,39 +35,30 @@ expected_stderr = """
Statement failed, SQLSTATE = 23000
violation of FOREIGN KEY constraint "REF_KEY" on table "EMPLOYEE"
-Foreign key reference target does not exist
-Problematic key value is ("DEPT_NO" = '-1')
-Problematic key value is ("DEPT_NO" = -1)
"""
expected_stdout = """
test_expected_stdout = """
Records affected: 0
"""
@pytest.mark.skip('FIXME: Not IMPLEMENTED')
@pytest.mark.version('>=3.0')
def test_1(act: Action):
pytest.fail("Not IMPLEMENTED")
sql_init = (act.files_dir / 'gtcs-ref-integ-init.sql').read_text()
sql_addi = '''
alter index dept_key inactive;
commit;
set count on;
insert into employee values (11, 'e11', -1); -- ==> Records affected: 0
'''
act.expected_stdout = test_expected_stdout
act.expected_stderr = test_expected_stderr
act.isql(switches=['-q'], input = os.linesep.join( (sql_init, sql_addi) ) )
assert (act.clean_stdout == act.clean_expected_stdout and
act.clean_stderr == act.clean_expected_stderr)
# test_script_1
#---
#
# import os
# import sys
# import subprocess
#
# os.environ["ISC_USER"] = user_name
# os.environ["ISC_PASSWORD"] = user_password
#
# db_conn.close()
#
# with open( os.path.join(context['files_location'],'gtcs-ref-integ.sql'), 'r') as f:
# sql_init = f.read()
#
# sql_addi='''
# alter index dept_key inactive;
# commit;
# set count on;
# insert into employee values (11, 'e11', -1); -- ==> Records affected: 0
# '''
#
# runProgram('isql', [ dsn], os.linesep.join( (sql_init, sql_addi) ) )
#---