feluelle commented on a change in pull request #6467: [AIRFLOW-5814] 
Implementing Presto hook tests
URL: https://github.com/apache/airflow/pull/6467#discussion_r341145830
 
 

 ##########
 File path: tests/hooks/test_presto_hook.py
 ##########
 @@ -51,3 +51,39 @@ def test_insert_rows(self, mock_insert_rows):
         target_fields = None
         self.db_hook.insert_rows(table, rows, target_fields)
         mock_insert_rows.assert_called_once_with(table, rows, None, 0)
+
+    def test_get_first_record(self):
+        statement = 'SQL'
+        result_sets = [('row1',), ('row2',)]
+        self.cur.fetchone.return_value = result_sets[0]
+
+        self.assertEqual(result_sets[0], self.db_hook.get_first(statement))
+        assert self.conn.close.call_count == 1
 
 Review comment:
   ```suggestion
           self.conn.close.assert_called_once_with()
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to