mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[FIX] fix tests failing in ci
This commit is contained in:
@@ -60,8 +60,9 @@ class TestBaseExternalDbsource(common.TransactionCase):
|
|||||||
|
|
||||||
def test_connection_success(self):
|
def test_connection_success(self):
|
||||||
""" It should raise for successful connection """
|
""" It should raise for successful connection """
|
||||||
with self.assertRaises(ConnectionSuccessError):
|
with mock.patch.object(self.dbsource, 'connection_open_postgresql'):
|
||||||
self.dbsource.connection_test()
|
with self.assertRaises(ConnectionSuccessError):
|
||||||
|
self.dbsource.connection_test()
|
||||||
|
|
||||||
def test_connection_fail(self):
|
def test_connection_fail(self):
|
||||||
""" It should raise for failed/invalid connection """
|
""" It should raise for failed/invalid connection """
|
||||||
@@ -72,12 +73,13 @@ class TestBaseExternalDbsource(common.TransactionCase):
|
|||||||
|
|
||||||
def test_connection_open_calls_close(self):
|
def test_connection_open_calls_close(self):
|
||||||
""" It should close connection after context ends """
|
""" It should close connection after context ends """
|
||||||
with mock.patch.object(
|
with mock.patch.object(self.dbsource, 'connection_open_postgresql'):
|
||||||
self.dbsource, 'connection_close',
|
with mock.patch.object(
|
||||||
) as close:
|
self.dbsource, 'connection_close',
|
||||||
with self.dbsource.connection_open():
|
) as close:
|
||||||
pass
|
with self.dbsource.connection_open():
|
||||||
close.assert_called_once()
|
pass
|
||||||
|
close.assert_called_once()
|
||||||
|
|
||||||
def test_connection_close(self):
|
def test_connection_close(self):
|
||||||
""" It should call adapter's close method """
|
""" It should call adapter's close method """
|
||||||
|
|||||||
Reference in New Issue
Block a user