from enum import Enum

from rgltr.config import configure
from rgltr.coverage import build_coverage_report
from rgltr.types import ToolRules


class Tag(Enum):
    CUSTOMER = "customer"


class Boundary(Enum):
    EXTERNAL = "external"


def test_coverage_report_includes_boundaries():
    configure(boundaries={Boundary.EXTERNAL: [Tag.CUSTOMER]})
    report = build_coverage_report({"get_customer": ToolRules()})

    assert report["boundaries"] == {"Boundary.EXTERNAL": ["customer"]}


def test_coverage_report_includes_governed():
    report = build_coverage_report({"get_customer": ToolRules(governed=True)})

    assert report["function_tools"]["get_customer"]["governed"] is True
