Skip to content

Commit a0888cf

Browse files
committed
Added/Updated tests\functional\database\create\test_13.py: added second check: ensure that 'gstat -h' shows 'force write' in the 'Attributes' line
1 parent 05e5f8d commit a0888cf

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

tests/functional/database/create/test_13.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
Test was requested by dimitr, letter: 15.04.2024 20:32.
88
See: https://github.com/FirebirdSQL/firebird/commit/d96d26d0a1cdfd6edcfa8b1bbda8f8da4ec4b5ef
99
"""
10-
10+
import locale
1111
import pytest
1212
from firebird.qa import *
1313

1414
db = db_factory()
15-
db_temp = db_factory(filename = 'tmp4test.tmp', do_not_create=True, do_not_drop=True)
15+
db_temp = db_factory(filename = 'tmp4test.tmp', do_not_create=True)
1616

17-
act = python_act('db', substitutions=[('[\t ]+', ' '),] )
17+
act = python_act('db', substitutions=[('^((?!(force write)).)*$', ''), ('[\t ]+', ' '),] )
1818

1919
@pytest.mark.version('>=3')
2020
def test_2(act: Action, db_temp: Database,):
@@ -23,15 +23,27 @@ def test_2(act: Action, db_temp: Database,):
2323
set list on;
2424
commit;
2525
create database '{db_temp.dsn}' user {act.db.user} password '{act.db.password}';
26-
select m.mon$forced_writes as fw from mon$database m;
26+
select m.mon$forced_writes as "force write" from mon$database m;
2727
commit;
28-
drop database;
2928
"""
3029

3130
expected_stdout_isql = """
32-
FW 1
31+
force write 1
3332
"""
3433

34+
# Check-1: ensure that mon$database.forced_writes contains 1:
35+
##########
3536
act.isql(switches=['-q'], input=init_script, connect_db = False, credentials = False, combine_output=True)
3637
act.expected_stdout = expected_stdout_isql
3738
assert act.clean_stdout == act.clean_expected_stdout
39+
act.reset()
40+
41+
# Check-2: ensure that 'gstat -h' shows 'force write' in the 'Attributes' line:
42+
##########
43+
act.expected_stdout = """
44+
Attributes force write
45+
"""
46+
act.gstat(switches=['-h', db_temp.db_path], connect_db=False, credentials = False, io_enc = locale.getpreferredencoding())
47+
assert act.clean_stdout == act.clean_expected_stdout
48+
49+

0 commit comments

Comments
 (0)