Skip to content

Commit

Permalink
also test with transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
msullivan committed Feb 5, 2024
1 parent 82f5a07 commit 1686041
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,17 @@ async def test_branch_drop_recreate(self):
finally:
await tb.drop_db(self.con, 'test_db_drop')

async def test_branch_drop_disconnect(self):
async def _test_branch_drop_disconnect(self, *, with_transaction):
if not self.has_create_database:
self.skipTest("create branch is not supported by the backend")

await self.con.execute('CREATE EMPTY BRANCH test_db_disconnect;')
conn = await self.connect(database='test_db_disconnect')

try:
if with_transaction:
await conn.query('START TRANSACTION')

dbname = await conn.query(
'SELECT sys::get_current_database();')
self.assertEqual(dbname, ['test_db_disconnect'])
Expand All @@ -264,6 +267,12 @@ async def test_branch_drop_disconnect(self):
except edgedb.UnknownDatabaseError:
pass

async def test_branch_drop_disconnect_01(self):
await self._test_branch_drop_disconnect(with_transaction=False)

async def test_branch_drop_disconnect_02(self):
await self._test_branch_drop_disconnect(with_transaction=True)

async def test_branch_rename_disconnect(self):
if not self.has_create_database:
self.skipTest("create branch is not supported by the backend")
Expand Down

0 comments on commit 1686041

Please sign in to comment.