"""Unit tests for ExcelImageExtractionService."""

import pytest
from unittest.mock import Mock, patch

from src.extraction_v2.excel_image_extraction_service import (
    ExcelImageExtractionService,
    get_excel_image_extraction_service
)


class TestExcelImageExtractionService:
    """Tests for ExcelImageExtractionService class."""

    def test_service_can_be_imported(self):
        """Test that service can be imported."""
        assert ExcelImageExtractionService is not None

    def test_factory_function_works(self):
        """Test that factory function returns service instance."""
        # Clear cache
        get_excel_image_extraction_service.cache_clear()

        service = get_excel_image_extraction_service()

        assert service is not None
        assert isinstance(service, ExcelImageExtractionService)

    def test_service_initializes_with_azure_chat_dependency(self):
        """Test that service initializes with AzureChatService dependency."""
        mock_chat_service = Mock()

        service = ExcelImageExtractionService(azure_chat_service=mock_chat_service)

        assert service.azure_chat_service is mock_chat_service
