Commit 73045b69 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Clean up agentic service workflow

parent db012571
Loading
Loading
Loading
Loading
+999 −910

File changed.

Preview size limit exceeded, changes collapsed.

+34 −0
Original line number Diff line number Diff line
@@ -23,6 +23,10 @@ from agentic.Config import (
)
from agentic.service import peer_client
from agentic.service.spectrum import spectrum_request
from agentic.service.tools.service_workflow import (
    _resolve_device_uuid_from_details,
    _resolve_endpoint_uuid_from_details,
)


def test_agentic_default_config(monkeypatch) -> None:
@@ -56,3 +60,33 @@ def test_required_slots_from_capacity_and_modulation() -> None:
    result = spectrum_request(capacity_gbps=100.0, modulation_format="dp-qpsk")
    assert result["slot_width_ghz"] == 6.25
    assert result["required_slots"] > 0


def test_tfs_device_detail_endpoint_resolution() -> None:
    devices = [
        {
            "name": "DC1-TP1",
            "device_id": {"device_uuid": {"uuid": "device-uuid-1"}},
            "device_endpoints": [
                {
                    "name": "CHANNEL",
                    "endpoint_id": {
                        "endpoint_uuid": {"uuid": "endpoint-uuid-1"},
                    },
                },
            ],
        },
    ]

    assert (
        _resolve_device_uuid_from_details(devices, "DC1-TP1")
        == "device-uuid-1"
    )
    assert (
        _resolve_endpoint_uuid_from_details(
            devices,
            "device-uuid-1",
            "CHANNEL",
        )
        == "endpoint-uuid-1"
    )