def test_run_query(self): ''' Test for Run SQL query and return result ''' with patch.object(oracle, '_connect', MagicMock()) as mock_connect: mock_connect.cursor.execute.fetchall.return_value = True with patch.object(oracle, 'show_dbs', MagicMock()): self.assertTrue(oracle.run_query('db', 'query'))
def test_run_query(self): ''' Test for Run SQL query and return result ''' with patch.object(oracle, '_connect', MagicMock()) as mock_connect: mock_connect.cursor.execute.fetchall.return_value = True with patch.object(oracle, 'show_dbs', MagicMock()): self.assertTrue(oracle.run_query('db', 'query'))
def test_run_query(self): """ Test for Run SQL query and return result """ with patch.object(oracle, "_connect", MagicMock()) as mock_connect: mock_connect.cursor.execute.fetchall.return_value = True with patch.object(oracle, "show_dbs", MagicMock()): self.assertTrue(oracle.run_query("db", "query"))