[IMP] base_external_dbsource_mysql: black, isort, prettier

This commit is contained in:
Víctor Martínez
2022-11-23 08:17:23 +01:00
committed by David Alonso // Solvos
parent 4ded4709a5
commit af80458cb4
2 changed files with 4 additions and 4 deletions

View File

@@ -15,19 +15,19 @@ class TestBaseExternalDbsource(common.TransactionCase):
self.dbsource = self.env.ref("base_external_dbsource_mysql.demo_mysql")
def test_connection_close_mysql(self):
""" It should close the connection """
"""It should close the connection"""
connection = mock.MagicMock()
res = self.dbsource.connection_close_mysql(connection)
self.assertEqual(res, connection.close())
def test_connection_open_mysql(self):
""" It should call SQLAlchemy open """
"""It should call SQLAlchemy open"""
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 """
"""It should pass args to SQLAlchemy execute"""
expect = "sqlquery", "sqlparams", "metadata"
with mock.patch.object(self.dbsource, "execute_mysql") as parent_method:
self.dbsource.execute_mysql(*expect)