"""Tests for ratatoskr.sessions (caller-semantic types + `endpoint_for_plane`).

Post worldtree-sdk cutover the `sessions` module is down to `endpoint_for_plane`
(the Bifrost provider-plane helper) + the caller-semantic exception classes the
`ratatoskr.wt` adapter raises; every wire wrapper has retired onto the SDK adapter
(the wrappers' tests live in `test_wt.py`)."""

import pytest

from ratatoskr.sessions import endpoint_for_plane


class TestEndpointForPlane:
    """Issue #17 — endpoint_for_plane: plane name → Worldtree-visible base URL."""

    def test_memory_plane_maps_to_8391(self) -> None:
        """memory [tracer]: 'memory' → http://<host>:8391 (POST-001)."""
        assert endpoint_for_plane("memory", "10.100.10.50") == "http://10.100.10.50:8391"

    def test_affect_plane_maps_to_8390(self) -> None:
        """affect: 'affect' → http://<host>:8390 (POST-001)."""
        assert endpoint_for_plane("affect", "10.100.10.50") == "http://10.100.10.50:8390"

    def test_combined_plane_maps_to_8392(self) -> None:
        """combined [#18 composite]: 'combined' → http://<host>:8392 (POST-001)."""
        assert endpoint_for_plane("combined", "10.100.10.50") == "http://10.100.10.50:8392"

    def test_unknown_plane_raises_value_error(self) -> None:
        """unknown_plane [adversarial]: any other plane → ValueError (PRE-001)."""
        with pytest.raises(ValueError):
            endpoint_for_plane("persona", "10.100.10.50")
