from __future__ import annotations

from core.logging.banner import build_service_banner


def test_build_service_banner_contains_service_name() -> None:
    banner = build_service_banner(
        service_name="web",
        environment="dev",
    )

    assert "WEB" in banner
    assert "dev" in banner


def test_build_service_banner_uppercases_service_name() -> None:
    banner = build_service_banner(
        service_name="worker-critical",
        environment="prod",
    )

    assert "WORKER-CCRITICAL" in banner.upper() or "WORKER" in banner


def test_build_service_banner_includes_border() -> None:
    banner = build_service_banner(
        service_name="web",
        environment="dev",
    )

    lines = banner.strip().split("\n")
    assert len(lines) >= 3
    assert all(line.startswith("=") or "WEB" in line or "dev" in line for line in lines)
