"""
Tests for constants.py

Tests cover:
- USER_AGENT constant
- BROWSER_USER_AGENT constant
"""


class TestUserAgent:
    """Tests for USER_AGENT constant."""

    def test_user_agent_exists(self):
        """Test USER_AGENT constant exists."""
        from local_deep_research.constants import USER_AGENT

        assert USER_AGENT is not None
        assert isinstance(USER_AGENT, str)

    def test_user_agent_contains_project_name(self):
        """Test USER_AGENT contains project name."""
        from local_deep_research.constants import USER_AGENT

        assert "Local-Deep-Research" in USER_AGENT

    def test_user_agent_contains_version(self):
        """Test USER_AGENT contains version."""
        from local_deep_research.constants import USER_AGENT
        from local_deep_research.__version__ import __version__

        assert __version__ in USER_AGENT

    def test_user_agent_contains_github_url(self):
        """Test USER_AGENT contains GitHub URL."""
        from local_deep_research.constants import USER_AGENT

        assert "github.com/LearningCircuit/local-deep-research" in USER_AGENT

    def test_user_agent_contains_description(self):
        """Test USER_AGENT contains description."""
        from local_deep_research.constants import USER_AGENT

        assert "Academic Research Tool" in USER_AGENT


class TestBrowserUserAgent:
    """Tests for BROWSER_USER_AGENT constant."""

    def test_browser_user_agent_exists(self):
        """Test BROWSER_USER_AGENT constant exists."""
        from local_deep_research.constants import BROWSER_USER_AGENT

        assert BROWSER_USER_AGENT is not None
        assert isinstance(BROWSER_USER_AGENT, str)

    def test_browser_user_agent_looks_like_browser(self):
        """Test BROWSER_USER_AGENT looks like a browser."""
        from local_deep_research.constants import BROWSER_USER_AGENT

        assert "Mozilla" in BROWSER_USER_AGENT
        assert "AppleWebKit" in BROWSER_USER_AGENT

    def test_browser_user_agent_contains_chrome(self):
        """Test BROWSER_USER_AGENT contains Chrome."""
        from local_deep_research.constants import BROWSER_USER_AGENT

        assert "Chrome" in BROWSER_USER_AGENT

    def test_browser_user_agent_contains_windows(self):
        """Test BROWSER_USER_AGENT contains Windows."""
        from local_deep_research.constants import BROWSER_USER_AGENT

        assert "Windows" in BROWSER_USER_AGENT


class TestVersionImport:
    """Tests for version import."""

    def test_version_exists(self):
        """Test __version__ exists."""
        from local_deep_research.__version__ import __version__

        assert __version__ is not None
        assert isinstance(__version__, str)

    def test_version_not_empty(self):
        """Test __version__ is not empty."""
        from local_deep_research.__version__ import __version__

        assert len(__version__) > 0
