From 101f29f0b4183568620fb5d67adca9336f83c46a Mon Sep 17 00:00:00 2001 From: Pavan Kumar Date: Tue, 24 Jun 2025 08:36:29 +0100 Subject: [PATCH 1/2] Airbyte test fixes, make mock JobResponse response id as int --- .../airbyte/tests/unit/airbyte/hooks/test_airbyte.py | 4 ++-- .../airbyte/tests/unit/airbyte/triggers/test_airbyte.py | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py b/providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py index 6f19b49c51ec9..9dd563da9aaa9 100644 --- a/providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py +++ b/providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py @@ -97,7 +97,7 @@ def test_get_job_status(self, get_job_mock): mock_response = mock.AsyncMock() mock_response.job_response = JobResponse( connection_id="connection-mock", - job_id="1", + job_id=1, start_time="today", job_type=JobTypeEnum.SYNC, status=JobStatusEnum.RUNNING, @@ -111,7 +111,7 @@ def test_cancel_job(self, cancel_job_mock): mock_response = mock.Mock() mock_response.job_response = JobResponse( connection_id="connection-mock", - job_id="1", + job_id=1, start_time="today", job_type=JobTypeEnum.SYNC, status=JobStatusEnum.CANCELLED, diff --git a/providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py b/providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py index 55985e971db1c..64d9a81546709 100644 --- a/providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py +++ b/providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py @@ -229,9 +229,7 @@ async def test_airbyte_job_timeout(self, mock_get_job_status, mocked_is_still_ru ], ) @mock.patch("airflow.providers.airbyte.hooks.airbyte.AirbyteHook.get_job_status") - async def test_airbyte_job_is_still_running_success( - self, mock_get_job_status, mock_response, expected_status - ): + async def test_airbyte_job_is_still_running_success(self, mock_response, expected_status): """Test is_still_running with mocked response job status and assert the return response with expected value""" hook = mock.AsyncMock(AirbyteHook) @@ -253,9 +251,7 @@ async def test_airbyte_job_is_still_running_success( ], ) @mock.patch("airflow.providers.airbyte.hooks.airbyte.AirbyteHook.get_job_status") - async def test_airbyte_sync_run_is_still_running( - self, mock_get_job_status, mock_response, expected_status - ): + async def test_airbyte_sync_run_is_still_running(self, mock_response, expected_status): """Test is_still_running with mocked response job status and assert the return response with expected value""" airbyte_hook = mock.AsyncMock(AirbyteHook) From 598cf6f09adb0c6a2cb7b056dd0c1e8875b53147 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Date: Tue, 24 Jun 2025 08:45:46 +0100 Subject: [PATCH 2/2] Airbyte test fixes, make mock JobResponse response id as int --- .../airbyte/tests/unit/airbyte/triggers/test_airbyte.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py b/providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py index 64d9a81546709..55985e971db1c 100644 --- a/providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py +++ b/providers/airbyte/tests/unit/airbyte/triggers/test_airbyte.py @@ -229,7 +229,9 @@ async def test_airbyte_job_timeout(self, mock_get_job_status, mocked_is_still_ru ], ) @mock.patch("airflow.providers.airbyte.hooks.airbyte.AirbyteHook.get_job_status") - async def test_airbyte_job_is_still_running_success(self, mock_response, expected_status): + async def test_airbyte_job_is_still_running_success( + self, mock_get_job_status, mock_response, expected_status + ): """Test is_still_running with mocked response job status and assert the return response with expected value""" hook = mock.AsyncMock(AirbyteHook) @@ -251,7 +253,9 @@ async def test_airbyte_job_is_still_running_success(self, mock_response, expecte ], ) @mock.patch("airflow.providers.airbyte.hooks.airbyte.AirbyteHook.get_job_status") - async def test_airbyte_sync_run_is_still_running(self, mock_response, expected_status): + async def test_airbyte_sync_run_is_still_running( + self, mock_get_job_status, mock_response, expected_status + ): """Test is_still_running with mocked response job status and assert the return response with expected value""" airbyte_hook = mock.AsyncMock(AirbyteHook)