17 lines
436 B
Python
17 lines
436 B
Python
from __future__ import annotations
|
|
|
|
from uuid import uuid4
|
|
|
|
import pytest
|
|
from core.http.errors import ApiProblemError
|
|
|
|
from core.auth.models import CurrentUser
|
|
from v1.agent.service import ensure_session_owner
|
|
|
|
|
|
def test_owner_guard_denies_non_owner() -> None:
|
|
user = CurrentUser(id=uuid4(), phone="self@example.com")
|
|
|
|
with pytest.raises(ApiProblemError):
|
|
ensure_session_owner(owner_id="other-user", current_user=user)
|