mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
fix(test): assert _add_team_member_budget_table returns a copy, not mutation
PR #36234 refactored _add_team_member_budget_table to return model_copy(update=...) instead of mutating its input, but the success test still asserted result == team_info_response, which now fails because the input stays unmutated with team_member_budget_table=None while the returned copy carries the budget record. Rewrite the assertions to pin the new no-mutation contract: the return value is a distinct object, the input's budget field is untouched, the copy has the budget attached, and the other fields still match. Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
parent
f05d468769
commit
83aeadbb1a
1 changed files with 4 additions and 4 deletions
|
|
@ -924,18 +924,18 @@ async def test_add_team_member_budget_table_success():
|
|||
team_id="test-team-123", team_alias="Test Team"
|
||||
)
|
||||
|
||||
# Call the function
|
||||
result = await _add_team_member_budget_table(
|
||||
team_member_budget_id="budget-123",
|
||||
prisma_client=mock_prisma_client,
|
||||
team_info_response_object=team_info_response,
|
||||
)
|
||||
|
||||
# Verify the result
|
||||
assert result == team_info_response
|
||||
assert result is not team_info_response
|
||||
assert team_info_response.team_member_budget_table is None
|
||||
assert result.team_member_budget_table == mock_budget_record
|
||||
assert result.team_id == team_info_response.team_id
|
||||
assert result.team_alias == team_info_response.team_alias
|
||||
|
||||
# Verify database call was made correctly
|
||||
mock_prisma_client.db.litellm_budgettable.find_unique.assert_called_once_with(
|
||||
where={"budget_id": "budget-123"}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue