"""Header logo ROMFAST + titlu centrat.
Logo PNG real (/static/romfast_logo.png). Logo in header-left (brand top-left, ca pe romfast.ro).
Badge de mediu in header-center (sub
, mic, color:var(--muted)) — nu suprapune logo-ul si
pastreaza centrarea optica a titlului in coloana auto a grilei.
Testeaza:
- test_header_contine_by_romfast: img brand-logo in .header-left (NU in header-center)
- test_titlu_centrat: titlul e in .header-center (grila 3 coloane), controale la dreapta
"""
from __future__ import annotations
import os
import re
import tempfile
import pytest
from starlette.testclient import TestClient
@pytest.fixture()
def client(monkeypatch):
tmp = tempfile.mkdtemp()
monkeypatch.setenv("AUTOPASS_DB_PATH", os.path.join(tmp, "branding.db"))
from app.config import get_settings
get_settings.cache_clear()
from app.main import app
with TestClient(app) as c:
yield c
get_settings.cache_clear()
def _get_header(html: str) -> str:
"""Extrage continutul elementului ."""
m = re.search(r"", html, re.DOTALL | re.IGNORECASE)
assert m, " negasit in HTML"
return m.group(1)
def _get_style(html: str) -> str:
"""Extrage continutul primului ", html, re.DOTALL)
assert m, "