mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[IMP] base_external_dbsource_mysql: black, isort, prettier
This commit is contained in:
committed by
David Alonso // Solvos
parent
5d1a502e3d
commit
16ab68de54
@@ -4,18 +4,15 @@ import mock
|
||||
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
ADAPTER = ('odoo.addons.base_external_dbsource_mysql.models'
|
||||
'.base_external_dbsource.MySQLdb')
|
||||
ADAPTER = (
|
||||
"odoo.addons.base_external_dbsource_mysql.models" ".base_external_dbsource.MySQLdb"
|
||||
)
|
||||
|
||||
|
||||
class TestBaseExternalDbsource(common.TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestBaseExternalDbsource, self).setUp()
|
||||
self.dbsource = self.env.ref(
|
||||
'base_external_dbsource_mysql.demo_mysql',
|
||||
)
|
||||
self.dbsource = self.env.ref("base_external_dbsource_mysql.demo_mysql",)
|
||||
|
||||
def test_connection_close_mysql(self):
|
||||
""" It should close the connection """
|
||||
@@ -25,17 +22,13 @@ class TestBaseExternalDbsource(common.TransactionCase):
|
||||
|
||||
def test_connection_open_mysql(self):
|
||||
""" It should call SQLAlchemy open """
|
||||
with mock.patch.object(
|
||||
self.dbsource, 'connection_open_mysql'
|
||||
) as parent_method:
|
||||
with mock.patch.object(self.dbsource, "connection_open_mysql") as parent_method:
|
||||
self.dbsource.connection_open_mysql()
|
||||
parent_method.assert_called_once_with()
|
||||
|
||||
def test_excecute_mysql(self):
|
||||
""" It should pass args to SQLAlchemy execute """
|
||||
expect = 'sqlquery', 'sqlparams', 'metadata'
|
||||
with mock.patch.object(
|
||||
self.dbsource, 'execute_mysql'
|
||||
) as parent_method:
|
||||
expect = "sqlquery", "sqlparams", "metadata"
|
||||
with mock.patch.object(self.dbsource, "execute_mysql") as parent_method:
|
||||
self.dbsource.execute_mysql(*expect)
|
||||
parent_method.assert_called_once_with(*expect)
|
||||
|
||||
Reference in New Issue
Block a user