mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
test(agent_session_endpoints/conftest): support AND/OR operators in fake matcher
This commit is contained in:
parent
bd8d00ef62
commit
78103f18df
1 changed files with 9 additions and 0 deletions
|
|
@ -61,6 +61,15 @@ def _matches(row: _Row, where: Optional[Dict[str, Any]]) -> bool:
|
|||
if not where:
|
||||
return True
|
||||
for key, expected in where.items():
|
||||
# Compound boolean operators used by cursor pagination.
|
||||
if key == "AND":
|
||||
if not all(_matches(row, sub) for sub in expected):
|
||||
return False
|
||||
continue
|
||||
if key == "OR":
|
||||
if not any(_matches(row, sub) for sub in expected):
|
||||
return False
|
||||
continue
|
||||
actual = getattr(row, key, None)
|
||||
if isinstance(expected, dict):
|
||||
if "in" in expected:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue