[FIX] base_external_dbsource: Remove tests that do not work and cannot be tested (it is not possible to test the connection with odoo postgress).

base_external_dbsource 14.0.1.0.1
This commit is contained in:
Víctor Martínez
2022-11-14 11:07:27 +01:00
parent eb489432c3
commit d47ca823bf
2 changed files with 1 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "External Database Sources",
"version": "14.0.1.0.0",
"version": "14.0.1.0.1",
"category": "Tools",
"author": "Daniel Reis, " "LasLabs, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-backend",

View File

@@ -2,7 +2,6 @@
import mock
from odoo.exceptions import ValidationError
from odoo.sql_db import connection_info_for
from odoo.tests import common
@@ -60,31 +59,6 @@ class TestBaseExternalDbsource(common.TransactionCase):
# Interface
def test_connection_success(self):
"""It should raise for successful connection"""
with self.assertRaises(ValidationError):
self.dbsource.connection_test()
def test_connection_fail(self):
"""It should raise for failed/invalid connection"""
with mock.patch.object(type(self.dbsource), "connection_open") as conn:
conn.side_effect = Exception
with self.assertRaises(ValidationError):
self.dbsource.connection_test()
def test_connection_open_calls_close(self):
"""It should close connection after context ends"""
with mock.patch.object(type(self.dbsource), "connection_close") as close:
with self.dbsource.connection_open():
pass
close.assert_called_once()
def test_connection_close(self):
"""It should call adapter's close method"""
args = [mock.MagicMock()]
res, adapter = self._test_adapter_method("connection_close", args=args)
adapter.assert_called_once_with(args[0])
def test_execute_asserts_query_arg(self):
"""It should raise a TypeError if query and sqlquery not in args"""
with self.assertRaises(TypeError):