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


##########
airflow-core/tests/unit/dag_processing/bundles/test_base.py:
##########
@@ -202,6 +202,30 @@ def test_that_no_version_is_noop(self):
         assert b.lock_file_path is None
         assert b.lock_file is None
 
+    def test_log_exc_formats_message_correctly(self):
+        """Test that _log_exc correctly formats the log message with all 
parameters."""
+        from airflow.dag_processing.bundles.base import log as bundle_log
+
+        bundle_name = "test_bundle"
+        bundle_version = "v1.0.0"
+        lock = BundleVersionLock(
+            bundle_name=bundle_name,
+            bundle_version=bundle_version,
+        )
+
+        test_msg = "error when attempting to acquire lock"
+
+        with patch.object(bundle_log, "exception") as mock_exception:
+            lock._log_exc(test_msg)
+
+            mock_exception.assert_called_once()
+            call_args = mock_exception.call_args
+            assert call_args[0][0] == "%s name=%s version=%s lock_file=%s"
+            assert call_args[0][1] == test_msg
+            assert call_args[0][2] == bundle_name
+            assert call_args[0][3] == bundle_version
+            assert call_args[0][4] == lock.lock_file_path

Review Comment:
   ```suggestion
               assert mock_exception.mock_calls == [
                   call(
                       "%s name=%s version=%s lock_file=%s",
                       test_msg,
                       bundle_name,
                       bundle_version,
                       lock.ock_file_paht
                   )
               ]
   ```



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