Skip to content

Commit a411120

Browse files
committed
Change name scheme for tests
1 parent 3081aa0 commit a411120

File tree

4,364 files changed

+381368
-380016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,364 files changed

+381368
-380016
lines changed

tests/bugs/core_0000_test.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#coding:utf-8
2+
#
3+
# id: bugs.core_0000
4+
# title: Dummy test
5+
# decription:
6+
#
7+
# tracker_id: CORE-0000
8+
# min_versions: ['4.0']
9+
# versions: 4.0
10+
# qmid: None
11+
12+
import pytest
13+
from firebird.qa import db_factory, isql_act, Action
14+
15+
# version: 4.0
16+
# resources: None
17+
18+
substitutions_1 = []
19+
20+
init_script_1 = """"""
21+
22+
db_1 = db_factory(sql_dialect=3, init=init_script_1)
23+
24+
test_script_1 = """
25+
recreate table t1(id int);
26+
"""
27+
28+
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
29+
30+
31+
@pytest.mark.version('>=4.0')
32+
def test_1(act_1: Action):
33+
act_1.execute()
34+

tests/bugs/core_0001_test.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#coding:utf-8
2+
#
3+
# id: bugs.core_0001
4+
# title: FBserver shutsdown when a user password is attempted to be modified to a empty string
5+
# decription:
6+
# tracker_id: CORE-0001
7+
# min_versions: ['2.5.0']
8+
# versions: 3.0
9+
# qmid: None
10+
11+
import pytest
12+
from firebird.qa import db_factory, isql_act, Action
13+
14+
# version: 3.0
15+
# resources: None
16+
17+
substitutions_1 = []
18+
19+
init_script_1 = """"""
20+
21+
db_1 = db_factory(sql_dialect=3, init=init_script_1)
22+
23+
test_script_1 = """
24+
create or alter user tmp$c0001 password '123';
25+
commit;
26+
alter user tmp$c0001 password '';
27+
commit;
28+
drop user tmp$c0001;
29+
commit;
30+
"""
31+
32+
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
33+
34+
expected_stderr_1 = """
35+
Statement failed, SQLSTATE = 42000
36+
unsuccessful metadata update
37+
-ALTER USER TMP$C0001 failed
38+
-Password should not be empty string
39+
"""
40+
41+
@pytest.mark.version('>=3.0')
42+
def test_1(act_1: Action):
43+
act_1.expected_stderr = expected_stderr_1
44+
act_1.execute()
45+
assert act_1.clean_expected_stderr == act_1.clean_stderr
46+

tests/bugs/core_0002_test.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#coding:utf-8
2+
#
3+
# id: bugs.core_0002
4+
# title: Incorrect value returned with execute statement calculation
5+
# decription:
6+
# tracker_id: CORE-0002
7+
# min_versions: ['2.5.0']
8+
# versions: 2.5
9+
# qmid: None
10+
11+
import pytest
12+
from firebird.qa import db_factory, isql_act, Action
13+
14+
# version: 2.5
15+
# resources: None
16+
17+
substitutions_1 = []
18+
19+
init_script_1 = """"""
20+
21+
db_1 = db_factory(sql_dialect=3, init=init_script_1)
22+
23+
test_script_1 = """
24+
set list on;
25+
create table t1 (
26+
campo1 numeric(15,2),
27+
campo2 numeric(15,2)
28+
);
29+
commit;
30+
set term ^;
31+
create procedure teste
32+
returns (
33+
retorno numeric(15,2))
34+
as
35+
begin
36+
execute statement 'select first 1 (campo1*campo2) from t1' into :retorno;
37+
suspend;
38+
end
39+
^
40+
set term ;^
41+
commit;
42+
43+
insert into t1 (campo1, campo2) values (10.5, 5.5);
44+
commit;
45+
46+
select * from teste;
47+
"""
48+
49+
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
50+
51+
expected_stdout_1 = """
52+
RETORNO 57.75
53+
"""
54+
55+
@pytest.mark.version('>=2.5')
56+
def test_1(act_1: Action):
57+
act_1.expected_stdout = expected_stdout_1
58+
act_1.execute()
59+
assert act_1.clean_expected_stdout == act_1.clean_stdout
60+

tests/bugs/core_0010_test.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#coding:utf-8
2+
#
3+
# id: bugs.core_0010
4+
# title: Navigation vs IS NULL vs compound index
5+
# decription:
6+
# tracker_id: CORE-0010
7+
# min_versions: ['2.5.0']
8+
# versions: 2.5
9+
# qmid: None
10+
11+
import pytest
12+
from firebird.qa import db_factory, isql_act, Action
13+
14+
# version: 2.5
15+
# resources: None
16+
17+
substitutions_1 = []
18+
19+
init_script_1 = """"""
20+
21+
db_1 = db_factory(sql_dialect=3, init=init_script_1)
22+
23+
test_script_1 = """
24+
recreate table t (f1 int, f2 int);
25+
create index t_idx on t (f1, f2);
26+
27+
insert into t (f1, f2) values (1, 1);
28+
insert into t (f1, f2) values (null, 2);
29+
insert into t (f1, f2) values (3, 3);
30+
31+
set list on;
32+
33+
select *
34+
from t
35+
where f1 is null
36+
order by f1, f2;
37+
"""
38+
39+
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
40+
41+
expected_stdout_1 = """
42+
F1 <null>
43+
F2 2
44+
"""
45+
46+
@pytest.mark.version('>=2.5')
47+
def test_1(act_1: Action):
48+
act_1.expected_stdout = expected_stdout_1
49+
act_1.execute()
50+
assert act_1.clean_expected_stdout == act_1.clean_stdout
51+

tests/bugs/core_0014_test.py

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
#coding:utf-8
2+
#
3+
# id: bugs.core_0014
4+
# title: Trigger do it wrong
5+
# decription: Computed by columns inside triggers always=NULL
6+
# tracker_id: CORE-0014
7+
# min_versions: ['2.5.0']
8+
# versions: 2.5
9+
# qmid: None
10+
11+
import pytest
12+
from firebird.qa import db_factory, isql_act, Action
13+
14+
# version: 2.5
15+
# resources: None
16+
17+
substitutions_1 = []
18+
19+
init_script_1 = """"""
20+
21+
db_1 = db_factory(sql_dialect=3, init=init_script_1)
22+
23+
test_script_1 = """
24+
-- Works OK on 1.5.6 and up to 4.0.0.
25+
create domain dom_datum_vreme as timestamp not null;
26+
create domain dom_dokid as varchar(20) not null;
27+
create domain dom_jid as integer;
28+
create domain dom_kolicina as integer default 0;
29+
create domain dom_naziv as varchar(100) not null;
30+
create domain dom_novac as double precision default 0;
31+
create domain dom_rabat as float default 0;
32+
create domain dom_status as integer default 0;
33+
commit;
34+
35+
create table ulaz_master
36+
(
37+
ulzid dom_jid not null,
38+
datum dom_datum_vreme not null,
39+
broj_racuna dom_dokid not null,
40+
dobid dom_jid not null,
41+
dobavljac dom_naziv not null,
42+
napid dom_jid not null,
43+
nacin_placanja dom_naziv not null,
44+
datumprispeca timestamp, -- dom_datum_vreme null ,
45+
vrednost dom_novac default 0,
46+
rvrednost dom_novac default 0,
47+
status dom_status default 0,
48+
constraint pk_ulaz_master primary key (ulzid)
49+
);
50+
51+
create table ulaz_detalji
52+
(
53+
ulzid dom_jid not null,
54+
artid dom_jid not null,
55+
artikal dom_naziv not null,
56+
kolicina dom_kolicina default 0 not null,
57+
cena dom_novac default 0 not null,
58+
rabat dom_rabat default 0 not null,
59+
ukupno computed by (kolicina * cena),
60+
vratio dom_kolicina default 0,
61+
constraint pk_ulaz_detalji primary key (ulzid, artid)
62+
);
63+
64+
65+
set term ^;
66+
create trigger trig_ulaz_detalji_ai for ulaz_detalji
67+
active after insert position 0
68+
as
69+
begin
70+
71+
update ulaz_master u set u.vrednost = u.vrednost + new.ukupno
72+
where u.ulzid = new.ulzid;
73+
74+
update ulaz_master u set u.rvrednost = u.rvrednost + (1 - new.rabat/100) * new.ukupno
75+
where u.ulzid = new.ulzid;
76+
77+
end
78+
^
79+
set term ;^
80+
commit;
81+
82+
-- this trigger sets fiedls to null on rc8.
83+
-- on rc6 it works as it should.
84+
85+
insert into ulaz_master(ulzid, datum, broj_racuna, dobid, dobavljac, napid, nacin_placanja)
86+
values(1000, '19.03.2016 12:01:03', 'qwerty123', 78966, 'foo-bar', 32101, 'asd-fgh-jkl' );
87+
/*
88+
create domain dom_datum_vreme as timestamp not null;
89+
create domain dom_dokid as varchar(20) not null;
90+
create domain dom_jid as integer;
91+
create domain dom_kolicina as integer default 0;
92+
create domain dom_naziv as varchar(100) not null;
93+
create domain dom_novac as double precision default 0;
94+
create domain dom_rabat as float default 0;
95+
create domain dom_status as integer default 0;
96+
97+
datum dom_datum_vreme not null,
98+
broj_racuna dom_dokid not null,
99+
dobid dom_jid not null,
100+
dobavljac dom_naziv not null,
101+
napid dom_jid not null,
102+
nacin_placanja dom_naziv not null,
103+
*/
104+
105+
set list on;
106+
set count on;
107+
108+
select
109+
ulzid, datum, broj_racuna, dobid, dobavljac, napid, nacin_placanja, datumprispeca
110+
,cast(vrednost as numeric(10,2)) as vrednost
111+
,cast(rvrednost as numeric(10,2)) as rvrednost
112+
,status
113+
from ulaz_master;
114+
115+
insert into
116+
ulaz_detalji(ulzid, artid, artikal, kolicina, cena, rabat, vratio)
117+
values(1000, 1000, 'liste', 19, 7, 30, 0);
118+
119+
select
120+
ulzid, artid, artikal, kolicina,
121+
cast(cena as numeric(12,2)) as cena,
122+
rabat,
123+
cast(ukupno as numeric(12,2)) as ukupno,
124+
vratio
125+
from ulaz_detalji;
126+
127+
select
128+
ulzid, datum, broj_racuna, dobid, dobavljac, napid, nacin_placanja, datumprispeca
129+
,cast(vrednost as numeric(10,2)) as vrednost
130+
,cast(rvrednost as numeric(10,2)) as rvrednost
131+
,status
132+
from ulaz_master;
133+
134+
"""
135+
136+
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
137+
138+
expected_stdout_1 = """
139+
ULZID 1000
140+
DATUM 2016-03-19 12:01:03.0000
141+
BROJ_RACUNA qwerty123
142+
DOBID 78966
143+
DOBAVLJAC foo-bar
144+
NAPID 32101
145+
NACIN_PLACANJA asd-fgh-jkl
146+
DATUMPRISPECA <null>
147+
VREDNOST 0.00
148+
RVREDNOST 0.00
149+
STATUS 0
150+
151+
152+
Records affected: 1
153+
Records affected: 1
154+
155+
ULZID 1000
156+
ARTID 1000
157+
ARTIKAL liste
158+
KOLICINA 19
159+
CENA 7.00
160+
RABAT 30
161+
UKUPNO 133.00
162+
VRATIO 0
163+
164+
165+
Records affected: 1
166+
167+
ULZID 1000
168+
DATUM 2016-03-19 12:01:03.0000
169+
BROJ_RACUNA qwerty123
170+
DOBID 78966
171+
DOBAVLJAC foo-bar
172+
NAPID 32101
173+
NACIN_PLACANJA asd-fgh-jkl
174+
DATUMPRISPECA <null>
175+
VREDNOST 133.00
176+
RVREDNOST 93.10
177+
STATUS 0
178+
179+
Records affected: 1
180+
"""
181+
182+
@pytest.mark.version('>=2.5')
183+
def test_1(act_1: Action):
184+
act_1.expected_stdout = expected_stdout_1
185+
act_1.execute()
186+
assert act_1.clean_expected_stdout == act_1.clean_stdout
187+

0 commit comments

Comments
 (0)