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

72 lines
1.7 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-24 20:27:02 +01:00
"""
ID: issue-5067
ISSUE: 5067
TITLE: CREATE USER ... TAGS ( attr = 'prefix #suffix' ): suffix will be removed from
storage because of character '#' in the value of attribute
2022-01-24 20:27:02 +01:00
DESCRIPTION:
JIRA: CORE-4767
FBTEST: bugs.core_4767
2022-01-24 20:27:02 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set list on;
create or alter view v_user_tags as
select
a.sec$key tag
,a.sec$value val
from sec$users u
left join sec$user_attributes a on u.sec$user_name = a.sec$user_name
where upper(u.sec$user_name) = upper('tmp$c4767') and upper(u.sec$plugin) = upper('Srp')
;
commit;
create or alter user tmp$c4767 password '123' using plugin Srp tags (
attr00001='attr #00001'
,attr00002='#'
,attr00003='##'
,attr00004='$'
,attr00005='$$'
);
commit;
select * from v_user_tags;
commit;
2021-12-19 22:25:36 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
TAG ATTR00001
VAL attr #00001
TAG ATTR00002
VAL #
TAG ATTR00003
VAL ##
TAG ATTR00004
VAL $
TAG ATTR00005
VAL $$
2021-12-19 22:25:36 +01:00
"""
# cleanup fixture
2022-01-24 20:27:02 +01:00
tmp_user=user_factory('db', name='tmp$c4767', password='123', plugin='Srp',
do_not_create=True)
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-24 20:27:02 +01:00
def test_1(act: Action, tmp_user: User):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00