Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

1.0 KB
Raw Blame
"""GET /team/metadata_schema — the behavior actors declares no
``general_settings.team_metadata_schema``, so the route is an info route that
returns an empty field list to every authenticated actor and 401s without a key.
"""

import pytest

from tests.integration._support.actors import Actor

pytestmark = pytest.mark.asyncio(loop_scope="session")


@pytest.mark.parametrize("actor", list(Actor), ids=[a.value for a in Actor])
async def test_team_metadata_schema_default_is_empty(actor: Actor, gateway_client, actors):
    resp = await gateway_client.get(
        "/team/metadata_schema",
        headers={"Authorization": f"Bearer {actors.keys[actor].cleartext}"},
    )
    assert resp.status_code == 200, f"{actor.value}: {resp.status_code} {resp.text}"
    assert resp.json() == {"fields": []}


async def test_team_metadata_schema_requires_auth(gateway_client, actors):
    resp = await gateway_client.get("/team/metadata_schema", headers={"Authorization": "Bearer invalid"})
    assert resp.status_code == 401, resp.text