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

78 lines
1.8 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
# id: bugs.core_2712
# title: Do not print "invalid request BLR" for par.cpp errors with valid BLR
2021-11-16 19:44:53 +01:00
# decription:
#
2021-04-26 20:07:00 +02:00
# tracker_id: CORE-2712
# min_versions: ['3.0.0']
# versions: 3.0
# qmid: None
import pytest
2021-11-16 19:44:53 +01:00
from firebird.qa import db_factory, python_act, Action
from firebird.driver import DatabaseError
2021-04-26 20:07:00 +02:00
# version: 3.0
# resources: None
substitutions_1 = [('table id [0-9]+ is not defined', 'table is not defined')]
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
# test_script_1
#---
2021-11-16 19:44:53 +01:00
#
2021-04-26 20:07:00 +02:00
# import os
2021-11-16 19:44:53 +01:00
#
2021-04-26 20:07:00 +02:00
# os.environ["ISC_USER"] = user_name
# os.environ["ISC_PASSWORD"] = user_password
2021-11-16 19:44:53 +01:00
#
2021-04-26 20:07:00 +02:00
# db_conn.close()
# msg=''
2021-11-16 19:44:53 +01:00
#
2021-04-26 20:07:00 +02:00
# att1 = kdb.connect(dsn=dsn)
# cur1 = att1.cursor()
# cur1.execute("recreate table test(x int)")
# att1.commit()
# cur1.execute("insert into test values(1)")
# att1.commit()
2021-11-16 19:44:53 +01:00
#
2021-04-26 20:07:00 +02:00
# att2 = kdb.connect(dsn=dsn)
# cur2 = att2.cursor()
# cur2.execute("select 1 from rdb$database")
2021-11-16 19:44:53 +01:00
#
2021-04-26 20:07:00 +02:00
# cur1.execute("drop table test")
# try:
# cur2.prep("update test set x=-x")
# att2.commit()
# except Exception as e:
# msg = e[0]
# print(msg)
2021-11-16 19:44:53 +01:00
#
2021-04-26 20:07:00 +02:00
# att1.close()
# att2.close()
2021-11-16 19:44:53 +01:00
#
2021-04-26 20:07:00 +02:00
#---
2021-11-16 19:44:53 +01:00
act_1 = python_act('db_1', substitutions=substitutions_1)
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2021-11-16 19:44:53 +01:00
def test_1(act_1: Action, capsys):
with act_1.db.connect() as att1:
cur1 = att1.cursor()
cur1.execute("recreate table test(x int)")
att1.commit()
cur1.execute("insert into test values(1)")
att1.commit()
with act_1.db.connect() as att2:
cur2 = att2.cursor()
cur2.execute("select 1 from rdb$database")
2021-04-26 20:07:00 +02:00
2021-11-16 19:44:53 +01:00
cur1.execute("drop table test")
with pytest.raises(DatabaseError, match='.*table id [0-9]+ is not defined.*'):
cur2.prepare("update test set x=-x")
att2.commit()