mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
test: cover family counts with projection backlog reads
This commit is contained in:
parent
17a5c99c54
commit
96580bb3cd
1 changed files with 3 additions and 1 deletions
|
|
@ -20,6 +20,8 @@ class RuleRows:
|
|||
|
||||
async def query_raw(self, query: str, *args: object) -> object:
|
||||
self.calls += 1
|
||||
if "SELECT EXISTS" in query:
|
||||
return ({"pending": False},)
|
||||
return tuple({"record": rule.model_dump(mode="json")} for rule in self.rules)
|
||||
|
||||
|
||||
|
|
@ -52,7 +54,7 @@ async def test_family_counts_only_its_enabled_rules_without_an_extra_query(statu
|
|||
database: Final = RuleRows(rules)
|
||||
result: Final = next(setting for setting in (await family_settings(database)).data if setting.family == "spend")
|
||||
|
||||
assert database.calls == 1
|
||||
assert database.calls == 2 # existing rule rows plus the separate projection-backlog read
|
||||
assert result.enabled_rules == 2
|
||||
assert result.total_rules == 3
|
||||
assert result.evaluation_status_counts.model_dump() == {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue