예제 #1
0
 def test_jdbc_conn_connection(self, jdbc_mock):
     jdbc_hook = JdbcHook()
     jdbc_conn = jdbc_hook.get_conn()
     self.assertTrue(jdbc_mock.called)
     self.assertIsInstance(jdbc_conn, Mock)
     self.assertEqual(jdbc_conn.name, jdbc_mock.return_value.name)  # pylint: disable=no-member
예제 #2
0
 def test_jdbc_conn_get_autocommit(self, _):
     jdbc_hook = JdbcHook()
     jdbc_conn = jdbc_hook.get_conn()
     jdbc_hook.get_autocommit(jdbc_conn)
     jdbc_conn.jconn.getAutoCommit.assert_called_once_with()
예제 #3
0
 def test_jdbc_conn_connection(self, jdbc_mock):
     jdbc_hook = JdbcHook()
     jdbc_conn = jdbc_hook.get_conn()
     assert jdbc_mock.called
     assert isinstance(jdbc_conn, Mock)
     assert jdbc_conn.name == jdbc_mock.return_value.name  # pylint: disable=no-member