6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 05:53:06 +01:00
firebird-qa/tests/functional/procedure/create/test_03.py

76 lines
1.9 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-02-04 19:05:19 +01:00
"""
ID: procedure.create-03
TITLE: CREATE PROCEDURE - Output paramaters
DESCRIPTION:
FBTEST: functional.procedure.create.03
"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
test_script = """SET TERM ^;
2021-04-26 20:07:00 +02:00
CREATE PROCEDURE test RETURNS(
p1 SMALLINT, p2 INTEGER, p3 FLOAT, p4 DOUBLE PRECISION, p5 DECIMAL(9,3), p6 NUMERIC(10,4),
p7 DATE, p8 TIME, p9 TIMESTAMP, p10 CHAR(40), p11 VARCHAR(60), p12 NCHAR(70))
AS
BEGIN
p1=1;
p2=2;
p3=3.4;
p4=4.5;
p5=5.6;
p6=6.7;
p7='31.8.1995';
p8='13:45:57.1';
p9='29.2.200 14:46:59.9';
p10='Text p10';
p11='Text p11';
p12='Text p13';
END ^
SET TERM ;^
commit;
SHOW PROCEDURE test;"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
expected_stdout = """Procedure text:
2021-04-26 20:07:00 +02:00
=============================================================================
BEGIN
p1=1;
p2=2;
p3=3.4;
p4=4.5;
p5=5.6;
p6=6.7;
p7='31.8.1995';
p8='13:45:57.1';
p9='29.2.200 14:46:59.9';
p10='Text p10';
p11='Text p11';
p12='Text p13';
END
=============================================================================
Parameters:
P1 OUTPUT SMALLINT
P2 OUTPUT INTEGER
P3 OUTPUT FLOAT
P4 OUTPUT DOUBLE PRECISION
P5 OUTPUT DECIMAL(9, 3)
P6 OUTPUT NUMERIC(10, 4)
P7 OUTPUT DATE
P8 OUTPUT TIME
P9 OUTPUT TIMESTAMP
P10 OUTPUT CHAR(40)
P11 OUTPUT VARCHAR(60)
P12 OUTPUT CHAR(70) CHARACTER SET ISO8859_1"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout