2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-02-04 19:05:19 +01:00
|
|
|
"""
|
|
|
|
ID: intfunc.cast-21
|
|
|
|
TITLE: CAST TIMESTAMP -> VARCHAR
|
|
|
|
DESCRIPTION:
|
|
|
|
Be careful about date/time format on FB server !
|
|
|
|
Universal format is not defined or not documented.
|
|
|
|
FBTEST: functional.intfunc.cast.21
|
|
|
|
"""
|
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
|
|
|
act = isql_act('db', "SELECT CAST(CAST('1.4.2002 0:59:59.1' AS TIMESTAMP) AS VARCHAR(50)) FROM rdb$Database;")
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-02-04 19:05:19 +01:00
|
|
|
expected_stdout = """
|
|
|
|
CAST
|
2021-04-26 20:07:00 +02:00
|
|
|
==================================================
|
|
|
|
|
2022-02-04 19:05:19 +01:00
|
|
|
2002-04-01 00:59:59.1000
|
|
|
|
"""
|
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
|