From ad485149e5162041fb67ca8a2d2ca53da2c13f48 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Thu, 18 Apr 2024 09:07:36 +0300 Subject: [PATCH] Added/Updated tests\functional\domain\create\test_41.py: Added separate expected_err for 6.x+ after letter from Adriano, 15.04.2024 12:44. --- tests/functional/domain/create/test_41.py | 26 +++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/functional/domain/create/test_41.py b/tests/functional/domain/create/test_41.py index 63e095ae..ef9bbd3c 100644 --- a/tests/functional/domain/create/test_41.py +++ b/tests/functional/domain/create/test_41.py @@ -5,6 +5,10 @@ ID: domain.create-41 FBTEST: functional.domain.create.41 TITLE: CREATE DOMAIN - create two domain with same name DESCRIPTION: The creation of already existing domain must fail (SQLCODE -607) +NOTES: + [18.04.2024] pzotov + Added separate expected_err for 6.x+ after letter from Adriano, 15.04.2024 12:44. + Error message changed since gh-8072 ('Create if not exists') was implemented. """ import pytest @@ -14,14 +18,24 @@ db = db_factory(init="CREATE DOMAIN test AS INTEGER;") act = isql_act('db', "CREATE DOMAIN test AS VARCHAR(32);") -expected_stderr = """Statement failed, SQLSTATE = 23000 -unsuccessful metadata update --CREATE DOMAIN TEST failed --violation of PRIMARY or UNIQUE KEY constraint "RDB$INDEX_2" on table "RDB$FIELDS" --Problematic key value is ("RDB$FIELD_NAME" = 'TEST')""" - @pytest.mark.version('>=3.0') def test_1(act: Action): + if act.is_version('<6'): + expected_stderr = """ + Statement failed, SQLSTATE = 23000 + unsuccessful metadata update + -CREATE DOMAIN TEST failed + -violation of PRIMARY or UNIQUE KEY constraint "RDB$INDEX_2" on table "RDB$FIELDS" + -Problematic key value is ("RDB$FIELD_NAME" = 'TEST') + """ + else: + expected_stderr = """ + Statement failed, SQLSTATE = 42000 + unsuccessful metadata update + -CREATE DOMAIN TEST failed + -Domain TEST already exists + """ + act.expected_stderr = expected_stderr act.execute() assert act.clean_stderr == act.clean_expected_stderr