test descriptions
This commit is contained in:
@@ -58,14 +58,14 @@ def two_node_setup():
|
||||
|
||||
|
||||
def test_health_check(two_node_setup):
|
||||
"""GET /v1/health returns 200."""
|
||||
"GET /v1/health returns 200.\n\nTags: gateway, http, sdk"
|
||||
gateway_url, _, _ = two_node_setup
|
||||
with urllib.request.urlopen(f"{gateway_url}/v1/health") as resp:
|
||||
assert resp.status == 200
|
||||
|
||||
|
||||
def test_get_models_returns_preset_list(two_node_setup):
|
||||
"""GET /v1/models returns OpenAI-format list containing stub-model."""
|
||||
"GET /v1/models returns OpenAI-format list containing stub-model.\n\nTags: gateway, http, sdk"
|
||||
gateway_url, _, _ = two_node_setup
|
||||
with urllib.request.urlopen(f"{gateway_url}/v1/models") as resp:
|
||||
body = json.loads(resp.read())
|
||||
@@ -75,7 +75,7 @@ def test_get_models_returns_preset_list(two_node_setup):
|
||||
|
||||
|
||||
def test_non_streaming_via_openai_sdk(two_node_setup):
|
||||
"""OpenAI SDK returns a valid ChatCompletion from the gateway (non-streaming)."""
|
||||
"OpenAI SDK returns a valid ChatCompletion from the gateway (non-streaming).\n\nTags: gateway, http, sdk, streaming"
|
||||
import openai
|
||||
gateway_url, _, _ = two_node_setup
|
||||
client = openai.OpenAI(base_url=f"{gateway_url}/v1", api_key="test")
|
||||
@@ -88,7 +88,7 @@ def test_non_streaming_via_openai_sdk(two_node_setup):
|
||||
|
||||
|
||||
def test_streaming_via_openai_sdk(two_node_setup):
|
||||
"""stream=True delivers text/event-stream chunks parseable by the OpenAI SDK."""
|
||||
"stream=True delivers text/event-stream chunks parseable by the OpenAI SDK.\n\nTags: gateway, http, sdk, streaming"
|
||||
import openai
|
||||
gateway_url, _, _ = two_node_setup
|
||||
client = openai.OpenAI(base_url=f"{gateway_url}/v1", api_key="test")
|
||||
@@ -107,7 +107,7 @@ def test_streaming_via_openai_sdk(two_node_setup):
|
||||
|
||||
|
||||
def test_unavailable_model_returns_openai_format_503(two_node_setup):
|
||||
"""Unknown model → HTTP 503 with OpenAI-format error body (code='model_not_available')."""
|
||||
"Unknown model → HTTP 503 with OpenAI-format error body (code='model_not_available').\n\nTags: gateway, http, sdk"
|
||||
gateway_url, _, _ = two_node_setup
|
||||
payload = json.dumps({
|
||||
"model": "nonexistent-model",
|
||||
@@ -130,7 +130,7 @@ def test_unavailable_model_returns_openai_format_503(two_node_setup):
|
||||
|
||||
|
||||
def test_langchain_chat_openai(two_node_setup):
|
||||
"""LangChain ChatOpenAI works against the gateway."""
|
||||
"LangChain ChatOpenAI works against the gateway.\n\nTags: gateway, http, sdk"
|
||||
from langchain_openai import ChatOpenAI
|
||||
gateway_url, _, _ = two_node_setup
|
||||
llm = ChatOpenAI(
|
||||
@@ -143,7 +143,7 @@ def test_langchain_chat_openai(two_node_setup):
|
||||
|
||||
|
||||
def test_streaming_end_to_end_http(two_node_setup):
|
||||
"""End-to-end streaming at HTTP level: SSE format, DONE sentinel, content chunk."""
|
||||
"End-to-end streaming at HTTP level: SSE format, DONE sentinel, content chunk.\n\nTags: gateway, http, sdk, streaming"
|
||||
gateway_url, _, node_b = two_node_setup
|
||||
payload = json.dumps({
|
||||
"model": "stub-model",
|
||||
|
||||
Reference in New Issue
Block a user