async def test_trigger_sync_no_dag(self, mock_sync_with_schedule, mock_user):
        """Test triggering a sync with no DAG."""
        scheduler = PlatformScheduler()
        mock_db = AsyncMock()

        # Mock crud operations
        with (
            patch("airweave.platform.scheduler.get_db_context"),
            patch(
                "airweave.platform.scheduler.crud.user.get_by_email",
                new_callable=AsyncMock,
                return_value=mock_user,
            ),
            patch("airweave.platform.scheduler.crud.sync_job.create", new_callable=AsyncMock),
            patch(
                "airweave.platform.scheduler.crud.sync_dag.get_by_sync_id",
                new_callable=AsyncMock,
                return_value=None,
            ),
        ):
            # Execute method
            await scheduler._trigger_sync(mock_db, mock_sync_with_schedule)

            # Assert crud operations were called
            crud.user.get_by_email.assert_called_once()
            crud.sync_job.create.assert_called_once()
            crud.sync_dag.get_by_sync_id.assert_called_once()
Test triggering a sync with no DAG.
backend/tests/unit/platform/test_scheduler.py