[FIX] fix tests failing in ci

This commit is contained in:
hugues de keyzer
2023-07-10 22:28:01 +02:00
parent 74851db119
commit 887ac14cf9

View File

@@ -60,6 +60,7 @@ class TestBaseExternalDbsource(common.TransactionCase):
def test_connection_success(self):
""" It should raise for successful connection """
with mock.patch.object(self.dbsource, 'connection_open_postgresql'):
with self.assertRaises(ConnectionSuccessError):
self.dbsource.connection_test()
@@ -72,6 +73,7 @@ class TestBaseExternalDbsource(common.TransactionCase):
def test_connection_open_calls_close(self):
""" It should close connection after context ends """
with mock.patch.object(self.dbsource, 'connection_open_postgresql'):
with mock.patch.object(
self.dbsource, 'connection_close',
) as close: