"""Unit tests for configuration settings."""

import pytest

from src.core.config import Settings


def test_redis_url_default():
    """Test redis_url has correct default value when no env var set."""
    settings = Settings(_env_file=None)  # Don't load .env file
    assert settings.redis_url == "redis://localhost:6379"


def test_redis_url_local():
    """Test redis_url accepts local non-SSL URL with database."""
    settings = Settings(redis_url="redis://localhost:6379/2")
    assert settings.redis_url == "redis://localhost:6379/2"


def test_redis_url_azure_ssl():
    """Test redis_url accepts Azure SSL URL with password."""
    url = "rediss://:mypass@cache.redis.cache.windows.net:6380"
    settings = Settings(redis_url=url)
    assert settings.redis_url == url
