2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-02-04 19:05:19 +01:00
|
|
|
"""
|
|
|
|
ID: procedure.create-02
|
|
|
|
TITLE: CREATE PROCEDURE - Input parameters
|
|
|
|
DESCRIPTION:
|
|
|
|
FBTEST: functional.procedure.create.02
|
|
|
|
"""
|
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(
|
|
|
|
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
|
|
|
|
POST_EVENT 'Test';
|
|
|
|
END ^
|
|
|
|
SET TERM ;^
|
|
|
|
commit;
|
2021-12-22 20:25:10 +01:00
|
|
|
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
|
|
|
|
POST_EVENT 'Test';
|
|
|
|
END
|
|
|
|
=============================================================================
|
|
|
|
Parameters:
|
|
|
|
P1 INPUT SMALLINT
|
|
|
|
P2 INPUT INTEGER
|
|
|
|
P3 INPUT FLOAT
|
|
|
|
P4 INPUT DOUBLE PRECISION
|
|
|
|
P5 INPUT DECIMAL(9, 3)
|
|
|
|
P6 INPUT NUMERIC(10, 4)
|
|
|
|
P7 INPUT DATE
|
|
|
|
P8 INPUT TIME
|
|
|
|
P9 INPUT TIMESTAMP
|
|
|
|
P10 INPUT CHAR(40)
|
|
|
|
P11 INPUT VARCHAR(60)
|
2021-12-22 20:25:10 +01:00
|
|
|
P12 INPUT 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
|