Lee-W commented on code in PR #72051:
URL: https://github.com/apache/airflow/pull/72051#discussion_r4015838722


##########
providers/openai/tests/unit/openai/operators/test_openai.py:
##########
@@ -125,6 +125,75 @@ def 
test_openai_trigger_batch_operator_not_deferred(mock_batch, wait_for_complet
     assert batch_id == BATCH_ID
 
 
+def 
test_openai_trigger_batch_operator_create_batch_default_passthrough(mock_batch):
+    """No metadata/completion_window passed: create_batch must see the pre-PR 
defaults."""
+    operator = OpenAITriggerBatchOperator(
+        task_id=TASK_ID,
+        conn_id=CONN_ID,
+        file_id=FILE_ID,
+        endpoint=BATCH_ENDPOINT,
+        deferrable=False,
+        wait_for_completion=False,
+    )
+    mock_hook_instance = Mock(spec=OpenAIHook)
+    mock_hook_instance.create_batch.return_value = mock_batch
+    operator.hook = mock_hook_instance
+
+    operator.execute(Context())
+
+    mock_hook_instance.create_batch.assert_called_once_with(
+        file_id=FILE_ID,
+        endpoint=BATCH_ENDPOINT,
+        metadata=None,
+        completion_window="24h",
+    )
+
+
+def test_openai_trigger_batch_operator_create_batch_passthrough(mock_batch):

Review Comment:
   Both pairs are one parametrized function each now.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to