6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/functional/gtcs/test_external_file_09_d.py

88 lines
2.3 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: gtcs.external-file-09
FBTEST: functional.gtcs.external_file_09_d
TITLE: Test for external table with field of DATE datatype
DESCRIPTION:
Original test see in:
https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/EXT_REL_0_9_D.script
"""
2021-04-26 20:07:00 +02:00
import pytest
2022-02-04 19:05:19 +01:00
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 = python_act('db', substitutions=[('[ \t]+', ' ')])
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
expected_stderr = """
Statement failed, SQLSTATE = 22018
conversion error from string "29-feb-9999"
"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
expected_stdout = """
F01 1994-06-28
F01 2004-02-29
F01 2001-09-01
F01 0001-01-01
F01 9999-12-31
Records affected: 5
THIS_DAY_COUNT 2
"""
@pytest.mark.skip('FIXME: Not IMPLEMENTED')
@pytest.mark.version('>=3.0')
def test_1(act: Action):
pytest.fail("Not IMPLEMENTED")
2021-04-26 20:07:00 +02:00
# test_script_1
#---
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
# import os
# import sys
# import subprocess
# import time
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
# tmp_file = os.path.join(context['temp_directory'],'tmp_ext_09_d.tmp')
# if os.path.isfile( tmp_file):
# os.remove( tmp_file )
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
# this_fdb = db_conn.database_name
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
# sql_cmd='''
# connect 'localhost:%(this_fdb)s' user '%(user_name)s' password '%(user_password)s';
# create table ext_table external file '%(tmp_file)s' (f01 date);
# commit;
# -- connect 'localhost:%(this_fdb)s' user '%(user_name)s' password '%(user_password)s';
# insert into ext_table (f01) values ('28-June-94');
# insert into ext_table (f01) values ('29-feb-4');
# insert into ext_table (f01) values ('1-september-1');
# insert into ext_table (f01) values ('1-january-0001');
# insert into ext_table (f01) values ('31-december-9999');
# insert into ext_table (f01) values (current_date);
# insert into ext_table (f01) values (current_timestamp);
# insert into ext_table (f01) values ('29-feb-9999');
# commit;
# set list on;
# set count on;
# select * from ext_table where f01<>current_date;
# set count off;
# select count(*) as this_day_count from ext_table where f01=current_date;
# commit;
# ''' % dict(globals(), **locals())
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
# runProgram('isql', [ '-q' ], sql_cmd)
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
# f_sql_chk = open( os.path.join(context['temp_directory'],'tmp_ext_09_d.sql'), 'w')
# f_sql_chk.write(sql_cmd)
# f_sql_chk.close()
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
# time.sleep(1)
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
# os.remove(f_sql_chk.name)
# os.remove( tmp_file )
2022-02-04 19:05:19 +01:00
#
2021-04-26 20:07:00 +02:00
#---