6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/gh_6825_test.py

43 lines
1.0 KiB
Python
Raw Normal View History

#coding:utf-8
2022-01-27 20:08:36 +01:00
"""
ID: issue-6825
ISSUE: 6825
TITLE: Correct error message for DROP VIEW
DESCRIPTION:
FBTEST: bugs.gh_6825
2022-01-27 20:08:36 +01:00
"""
2022-01-27 20:08:36 +01:00
import pytest
from firebird.qa import *
2022-01-27 20:08:36 +01:00
db = db_factory()
2022-01-27 20:08:36 +01:00
test_script = """
recreate view v1 as select 1 x from rdb$database;
create or alter user tmp$gh_6825 password '123' using plugin Srp;
commit;
connect '$(DSN)' user tmp$gh_6825 password '123';
drop view v1;
commit;
connect '$(DSN)' user sysdba password 'masterkey';
drop user tmp$gh_6825 using plugin Srp;
commit;
"""
2022-01-27 20:08:36 +01:00
act = isql_act('db', test_script, substitutions=[('(-)?Effective user is.*', '')])
2022-01-27 20:08:36 +01:00
expected_stderr = """
Statement failed, SQLSTATE = 28000
unsuccessful metadata update
-DROP VIEW V1 failed
-no permission for DROP access to VIEW V1
-Effective user is TMP$GH_6825
"""
@pytest.mark.version('>=3.0.8')
2022-01-27 20:08:36 +01:00
def test_1(act: Action):
act.expected_stderr = expected_stderr
act.execute()
assert act.clean_stderr == act.clean_expected_stderr