mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-12 21:58:38 +00:00
test(responses): responses API Response object unit tests
This commit is contained in:
parent
708b2c1b05
commit
66806c480f
3 changed files with 149 additions and 0 deletions
|
@ -868,3 +868,20 @@ async def test_create_openai_response_with_invalid_text_format(openai_responses_
|
|||
model=model,
|
||||
text=OpenAIResponseText(format={"type": "invalid"}),
|
||||
)
|
||||
|
||||
|
||||
def test_openai_response_text_default_format_unique_instance():
|
||||
a = OpenAIResponseText()
|
||||
b = OpenAIResponseText()
|
||||
|
||||
assert a.format is not None
|
||||
assert b.format is not None
|
||||
|
||||
# Defaults to text format
|
||||
assert a.format.get("type") == "text"
|
||||
assert b.format.get("type") == "text"
|
||||
|
||||
# Unique instances (no shared mutable default)
|
||||
assert a.format is not b.format
|
||||
a.format["name"] = "custom-name"
|
||||
assert "name" not in b.format
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue