Skip to content

Commit 247f8e0

Browse files
committed
Added/Updated tests\bugs\gh_7979_test.py: adjusted generated .py code: removed unneeded call to services, replaced hard-coded values with variables.
1 parent 5da6350 commit 247f8e0

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

tests/bugs/gh_7979_test.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,31 +70,32 @@ def test_1(act: Action, tmp_run_py: Path, tmp_log_py: Path, tmp_sql_py: Path, ca
7070
7171
os.environ["ISC_USER"] = '{act.db.user}'
7272
os.environ["ISC_PASSWORD"] = '{act.db.password}'
73-
driver_config.fb_client_library.value = "{act.vars['fbclient']}"
73+
driver_config.fb_client_library.value = r"{act.vars['fbclient']}"
7474
75-
with connect_server('localhost:service_mgr') as srv:
76-
bin_isql="{act.vars['isql']}"
77-
bin_gfix="{act.vars['gfix']}"
78-
bin_gstat="{act.vars['gstat']}"
79-
80-
with connect('{act.db.dsn}') as con:
81-
#print(f"Trying to run gfix -shut full -force 0 '{act.db.dsn}'")
82-
subprocess.run( [bin_gfix, '-shut', 'full', '-force', '0', '{act.db.dsn}'] )
83-
subprocess.run( [bin_gstat, '-h', '{act.db.db_path}'] )
84-
#print(f"Trying to run gfix -online '{act.db.dsn}'")
85-
subprocess.run( [bin_gfix, '-online', '{act.db.dsn}'] )
86-
subprocess.run( [bin_gstat, '-h', '{act.db.db_path}'] )
75+
bin_isql = r"{act.vars['isql']}"
76+
bin_gfix = r"{act.vars['gfix']}"
77+
bin_gstat = r"{act.vars['gstat']}"
78+
db_conn = r'{act.db.dsn}'
79+
db_file = r'{act.db.db_path}'
80+
tmp_sql = r'{str(tmp_sql_py)}'
81+
82+
with connect(db_conn) as con:
83+
#print(f"Trying to run gfix -shut full -force 0 db_conn")
84+
subprocess.run( [bin_gfix, '-shut', 'full', '-force', '0', db_conn] )
85+
subprocess.run( [bin_gstat, '-h', db_file] )
86+
#print(f"Trying to run gfix -online db_conn")
87+
subprocess.run( [bin_gfix, '-online', db_conn] )
88+
subprocess.run( [bin_gstat, '-h', db_file] )
8789
8890
chk_sql='''
8991
set list on;
9092
set count on;
9193
select att_cnt from logger;
9294
'''
93-
with open('{str(tmp_sql_py)}', 'w') as f:
95+
with open(tmp_sql, 'w') as f:
9496
f.write(chk_sql)
9597
96-
#subprocess.run( [bin_isql, '-q', '-i', '{str(tmp_sql_py)}', '-user', os.environ["ISC_USER"], '-pas', os.environ["ISC_PASSWORD"], '{act.db.dsn}'] )
97-
subprocess.run( [bin_isql, '-q', '-i', '{str(tmp_sql_py)}', '{act.db.dsn}'] )
98+
subprocess.run( [bin_isql, '-q', '-i', tmp_sql, db_conn] )
9899
"""
99100

100101
tmp_run_py.write_text(py_source)

0 commit comments

Comments
 (0)