Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acsierra committed Apr 30, 2024
1 parent fb216bc commit 32acac3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/providers/cncf/kubernetes/operators/test_pod.py
Expand Up @@ -1999,12 +1999,14 @@ def test_async_write_logs_should_execute_successfully(
else:
mock_manager.return_value.read_pod_logs.assert_not_called()

@patch(KUB_OP_PATH.format("post_complete_action"))
@pytest.mark.parametrize("evaluate_status", [404, None])
@patch(KUB_OP_PATH.format("extract_xcom"))
@patch(HOOK_CLASS)
@patch(KUB_OP_PATH.format("pod_manager"))
def test_async_write_logs_handler_api_exception(self, mock_manager, mocked_hook, mock_extract_xcom):
mock_manager.read_pod_logs.return_value = ApiException(status=404)
def test_async_write_logs_handler_api_exception(
self, mock_manager, mocked_hook, mock_extract_xcom, evaluate_status
):
mock_manager.read_pod_logs.return_value = ApiException(status=evaluate_status)
mocked_hook.return_value.get_pod.return_value = k8s.V1Pod(
metadata=k8s.V1ObjectMeta(name=TEST_NAME, namespace=TEST_NAMESPACE)
)
Expand Down

0 comments on commit 32acac3

Please sign in to comment.