Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/integration/dbapi/async/V2/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ async def service_account_no_user(
with connection_system_engine_no_db.cursor() as cursor:
await cursor.execute(
f'CREATE SERVICE ACCOUNT "{sa_account_name}" '
'WITH DESCRIPTION = "Ecosytem test with no user"'
"WITH DESCRIPTION = 'Ecosytem test with no user'"
)
await cursor.execute(f"CALL fb_GENERATESERVICEACCOUNTKEY('{sa_account_name}')")
# service_account_name, service_account_id, secret
Expand Down
15 changes: 10 additions & 5 deletions tests/integration/dbapi/async/V2/test_system_engine_async.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
from typing import List

from pytest import raises
Expand All @@ -7,6 +8,10 @@
from firebolt.utils.exception import OperationalError
from tests.integration.dbapi.utils import assert_deep_eq

system_error_pattern = re.compile(
r"system engine doesn't support .* statements. Run this statement on a user engine."
)


async def test_system_engine(
connection_system_engine: Connection,
Expand Down Expand Up @@ -48,11 +53,11 @@ async def test_system_engine(

if connection_system_engine.database:
await c.execute("show tables")
await c.execute(
"create table if not exists test_async(id int) primary index id"
)
with raises(OperationalError):
await c.execute("insert into test values (1)")
with raises(OperationalError) as e:
# Either one or another query fails if we're not on a user engine
await c.execute("create table if not exists test_async(id int)")
await c.execute("insert into test_async values (1)")
assert system_error_pattern.search(str(e.value)), "Invalid error message"
else:
await c.execute("show databases")
with raises(OperationalError):
Expand Down
13 changes: 10 additions & 3 deletions tests/integration/dbapi/sync/V2/test_system_engine.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
from typing import List

from pytest import raises
Expand All @@ -7,6 +8,10 @@
from firebolt.utils.exception import OperationalError
from tests.integration.dbapi.utils import assert_deep_eq

system_error_pattern = re.compile(
r"system engine doesn't support .* statements. Run this statement on a user engine."
)


def test_system_engine(
connection_system_engine: Connection,
Expand Down Expand Up @@ -48,9 +53,11 @@ def test_system_engine(

if connection_system_engine.database:
c.execute("show tables")
c.execute("create table if not exists test_sync(id int) primary index id")
with raises(OperationalError):
c.execute("insert into test values (1)")
with raises(OperationalError) as e:
# Either one or another query fails if we're not on a user engine
c.execute("create table if not exists test_sync(id int)")
c.execute("insert into test_sync values (1)")
assert system_error_pattern.search(str(e.value)), "Invalid error message"
else:
c.execute("show databases")
with raises(OperationalError):
Expand Down