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

Added/Updated bugs\core_4964_test.py. changed code: removed unneeded packages.

This commit is contained in:
zotov 2022-08-03 00:54:27 +03:00
parent 18998aed1c
commit 2a480a7b31

View File

@ -35,14 +35,12 @@ NOTES:
"""
import re
import shutil
import time
from pathlib import Path
from difflib import unified_diff
import pytest
from firebird.qa import *
from firebird.driver import connect, DatabaseError
substitutions = [('[ \t]+', ' '), ('file .* is not a valid database', 'file is not a valid database'), ]
@ -65,14 +63,6 @@ expected_stdout_log_diff = """
@pytest.mark.version('>=3.0')
def test_1(act: Action, tmp_user: User, capsys):
#-----------------------------------------------
def copy_with_metadata(src, tgt):
shutil.copy2(src, tgt)
if act.platform == 'Linux':
st = Path.stat(Path(src))
shutil.chown(tgt, st.st_uid, st.st_gid)
#-----------------------------------------------
fblog_1 = act.get_firebird_log()
# Scan line-by-line through databases.conf, find line starting with REQUIRED_ALIAS and extract name of file that
@ -101,7 +91,7 @@ def test_1(act: Action, tmp_user: User, capsys):
# PermissionError: [Errno 13] Permission denied --> probably because
# Firebird was started by root rather than current (non-privileged) user.
#
copy_with_metadata(str(act.db.db_path), str(tmp_fdb))
tmp_fdb.write_bytes(act.db.db_path.read_bytes())
check_sql = f'''
set bail on;