8000 Added/Updated tests\bugs\core_3305_test.py: Reimplemented: make singl… · FirebirdSQL/firebird-qa@fefe7d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit fefe7d1

Browse files
committed
Added/Updated tests\bugs\core_3305_test.py: Reimplemented: make single test function for the whole code, use different variables to store output on 3.x / 4.x+5.x / 6.x. Checked on 6.0.0.876; 5.0.3.1668; 4.0.6.3214; 3.0.13.33813.
1 parent 6fd7a2f commit fefe7d1

File tree

1 file changed

+25
-42
lines changed

1 file changed

+25
-42
lines changed

tests/bugs/core_3305_test.py

Lines changed: 25 additions & 42 deletions
70
Original file line numberDiff line numberDiff line change
@@ -7,74 +7,57 @@
77
DESCRIPTION:
88
JIRA: CORE-3305
99
FBTEST: bugs.core_3305
10+
NOTES:
11+
[27.06.2025] pzotov
12+
Reimplemented: make single test function for the whole code, use different variables to store output on 3.x / 4.x+5.x / 6.x
13+
No substitutions are used to suppress schema and quotes. Discussed with dimitr, 24.06.2025 12:39.
14+
15+
Checked on 6.0.0.876; 5.0.3.1668; 4.0.6.3214; 3.0.13.33813.
1016
"""
1117

1218
import pytest
1319
from firebird.qa import *
1420

1521
db = db_factory()
1622

17-
# version: 3.0
18-
19-
test_script_1 = """
20-
recreate table t(v int);
21-
commit;
23+
test_script = """
24+
recreate table test(v int);
2225
set term ^;
23-
create or alter trigger t_ai for t active after insert position 0 as
26+
create or alter trigger test_ai for test active AFTER insert position 0 as
2427
begin
2528
new.v = 1;
2629
end
2730
^
2831
set term ;^
29-
commit;
30-
insert into t(v) values(123);
32+
insert into test(v) values(123);
3133
rollback;
3234
"""
3335

34-
act_1 = isql_act('db', test_script_1)
36+
act = isql_act('db', test_script)
3537

36-
expected_stderr_1 = """
38+
expected_out_3x = """
3739
Statement failed, SQLSTATE = 42000
3840
attempted update of read-only column
3941
Statement failed, SQLSTATE = 42000
4042
attempted update of read-only column
4143
"""
4244

43-
@pytest.mark.version('>=3,<4.0')
44-
def test_1(act_1: Action):
45-
act_1.expected_stderr = expected_stderr_1
46-
act_1.execute()
47-
assert act_1.clean_stderr == act_1.clean_expected_stderr
48-
49-
# version: 4.0
50-
51-
test_script_2 = """
52-
recreate table t(v int);
53-
commit;
54-
set term ^;
55-
create or alter trigger t_ai for t active after insert position 0 as
56-
begin
57-
new.v = 1;
58-
end
59-
^
60-
set term ;^
61-
commit;
62-
insert into t(v) values(123);
63-
rollback;
45+
expected_out_5x = """
46+
Statement failed, SQLSTATE = 42000
47+
attempted update of read-only column TEST.V
48+
Statement failed, SQLSTATE = 42000
49+
attempted update of read-only column TEST.V
6450
"""
6551

66-
act_2 = isql_act('db', test_script_2)
67-
68-
expected_stderr_2 = """
52+
expected_out_6x = """
6953
Statement failed, SQLSTATE = 42000
-
attempted update of read-only column T.V
54+
attempted update of read-only column "PUBLIC"."TEST"."V"
7155
Statement failed, SQLSTATE = 42000
72-
attempted update of read-only column T.V
56+
attempted update of read-only column "PUBLIC"."TEST"."V"
7357
"""
7458

75-
@pytest.mark.version('>=4.0')
76-
def test_2(act_2: Action):
77-
act_2.expected_stderr = expected_stderr_2
78-
act_2.execute()
79-
assert act_2.clean_stderr == act_2.clean_expected_stderr
80-
59+
@pytest.mark.version('>=3')
60+
def test_1(act: Action):
61+
act.expected_stdout = expected_out_3x if act.is_version('<4') else expected_out_5x if act.is_version('<6') else expected_out_6x
62+
act.execute(combine_output = True)
63+
assert act.clean_stdout == act.clean_expected_stdout

0 commit comments

Comments
 (0)
0