mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-17 04:34:25 +00:00
test(integration): add list_value helper
Prerequisite for the backport of #46099 to stable/1.103.x: its integration
tests import list_value, which reached main in #43981.
Hand-ported from 43f07d0bd8 (main).
This commit is contained in:
parent
65e36b0298
commit
69ff376019
1 changed files with 6 additions and 1 deletions
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
import os
|
||||
import time
|
||||
import uuid
|
||||
from collections.abc import Callable, Iterator, Mapping
|
||||
from collections.abc import Callable, Iterator, Mapping, Sequence
|
||||
from contextlib import ExitStack, contextmanager
|
||||
from dataclasses import dataclass
|
||||
from hashlib import sha256
|
||||
|
|
@ -22,6 +22,11 @@ def object_value(value: JsonValue) -> dict[str, JsonValue]:
|
|||
return JSON_OBJECT.validate_python(value)
|
||||
|
||||
|
||||
def list_value(value: JsonValue) -> Sequence[JsonValue]:
|
||||
assert isinstance(value, list), f"Expected a list, received {type(value).__name__}"
|
||||
return value
|
||||
|
||||
|
||||
def string_value(value: JsonValue) -> str:
|
||||
assert isinstance(value, str), f"Expected a string, received {type(value).__name__}"
|
||||
return value
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue