import pytest

from app.config import get_settings

PULP_TEST_URL = "http://pulp.test"


@pytest.fixture(autouse=True)
def _settings_env(monkeypatch):
    """모든 테스트를 알려진 Pulp base_url 로 고정하고 settings 캐시를 초기화."""
    monkeypatch.setenv("PULP_BASE_URL", PULP_TEST_URL)
    monkeypatch.setenv("PULP_USERNAME", "admin")
    monkeypatch.setenv("PULP_PASSWORD", "secret")
    monkeypatch.setenv("PULP_VERIFY_TLS", "false")
    monkeypatch.setenv("PULP_CA_FILE", "")
    get_settings.cache_clear()
    yield
    get_settings.cache_clear()
