romsharon98 commented on PR #43248:
URL: https://github.com/apache/airflow/pull/43248#issuecomment-2446644651
> > The tests looks good. One small thing, in my opinion, when you want to
test a function that calls a function inside it you will want to mock the inner
call and just test the call has been done like you expected (and not really
call the inner function). Let me know what you think.
>
> Yeah, couldn't agree more with you, as you can see, that's how I got there
>
> ```
>
@patch("airflow.providers.cncf.kubernetes.backcompat.backwards_compat_converters._convert_kube_model_object")
> def test_convert_volume_mount_normal_value(mock_convert_kube_model_object):
> mock_convert_kube_model_object.return_value = k8s.V1VolumeMount(
> name="test_volume_mount", mount_path="/mnt/test"
> )
> ```
Yes but I think we need to add that we call the Mock function correctly for
example in this one we should add:
```python
mock_convert_kube_model_object.assert_called_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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]