utkarsharma2 commented on code in PR #35265:
URL: https://github.com/apache/airflow/pull/35265#discussion_r1375907484


##########
tests/providers/amazon/aws/operators/test_athena.py:
##########
@@ -201,6 +202,21 @@ def test_return_value(self, mock_conn, mock_run_query, 
mock_check_query_status):
 
         assert self.athena.execute(ti.get_template_context()) == 
ATHENA_QUERY_ID
 
+    @mock.patch.object(AthenaHook, "check_query_status", 
side_effect=("SUCCEEDED",))
+    @mock.patch.object(AthenaHook, "run_query", return_value=ATHENA_QUERY_ID)
+    @mock.patch.object(AthenaHook, "get_conn")
+    def test_optional_output_location(self, mock_conn, mock_run_query, 
mock_check_query_status):
+        op = AthenaOperator(**self.default_op_kwargs, aws_conn_id=None)
+
+        op.execute({})
+        mock_run_query.assert_called_once_with(
+            MOCK_DATA["query"],
+            query_context,
+            {},  # Should be an empty dict since we do not provide 
output_location

Review Comment:
   Should we instead test for when we provide the `output_location`? or I'm 
missing something?  



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to