"""
tests/test_semantic_model.py
"""

import pytest
import numpy as np
from src.models.semantic_model import SemanticSurrogate


def test_semantic_surrogate():
    surrogate = SemanticSurrogate()

    # Test bounds
    snr_linear = np.array([10.0, 100.0, 1000.0])
    k_n = 4
    sim = surrogate.get_similarity(snr_linear, k_n)

    assert np.all(sim >= 0) and np.all(sim <= 1)

    # Test monotonicity with SNR
    assert sim[0] < sim[1] < sim[2]

    # Test monotonicity with k_n
    sim_k4 = surrogate.get_similarity(snr_linear, 4)
    sim_k6 = surrogate.get_similarity(snr_linear, 6)

    assert np.all(sim_k4 < sim_k6)
