from __future__ import annotations

from datetime import datetime, timezone

import pytest

from argus.service.serving_spec import make_model_id_prefix


def test_make_model_id_prefix_uses_utc_minutes():
    dt = datetime(2026, 1, 6, 12, 35, 59, tzinfo=timezone.utc)
    assert make_model_id_prefix(user_id="alice", now_utc=dt) == "alice-202601061235"


def test_make_model_id_prefix_rejects_empty_user_id():
    with pytest.raises(ValueError, match="user_id is required"):
        make_model_id_prefix(user_id="", now_utc=datetime.now(timezone.utc))


def test_make_model_id_prefix_rejects_slash():
    with pytest.raises(ValueError, match="must not contain"):
        make_model_id_prefix(user_id="bad/user", now_utc=datetime.now(timezone.utc))

