From 688188c55af6fd25909b73bed23b49255de877b8 Mon Sep 17 00:00:00 2001 From: jesus Date: Tue, 20 Oct 2026 01:34:43 +0000 Subject: [PATCH] style(model hub): fix lint and format in custom metadata tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/unit/proxy/test_proxy_utils.py | 4 ++-- .../src/components/AIHub/ModelCustomMetadata.test.tsx | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/unit/proxy/test_proxy_utils.py b/tests/unit/proxy/test_proxy_utils.py index e8ed0cf5134..e3ee6b0259e 100644 --- a/tests/unit/proxy/test_proxy_utils.py +++ b/tests/unit/proxy/test_proxy_utils.py @@ -15,7 +15,6 @@ from litellm.types.guardrails import GuardrailEventHooks from unittest.mock import AsyncMock, MagicMock, patch import litellm -from litellm.router import Router from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth from litellm.proxy.auth.auth_utils import ( check_complete_credentials, @@ -25,6 +24,7 @@ from litellm.proxy.litellm_pre_call_utils import ( get_dynamic_logging_metadata, add_litellm_data_to_request, ) +from litellm.router import Router from pydantic import ValidationError pytestmark = pytest.mark.xdist_group("proxy_heavy") @@ -1679,7 +1679,6 @@ def test_get_model_group_info_merges_custom_tags_and_metadata_across_deployments assert (group.custom_tags, group.custom_metadata) == (expected_tags, expected_metadata) - @pytest.mark.parametrize( "alias_target", [pytest.param("gpt-4", id="string"), pytest.param({"model": "gpt-4", "hidden": False}, id="item")], @@ -1706,6 +1705,7 @@ def test_get_model_group_info_serves_the_target_groups_custom_fields_on_an_alias model_group: (("deprecated",), {"retirement_date": "2027-03-01"}) for model_group in ("gpt-4", "gpt-alias") } + @pytest.fixture def mock_team_data(): return [ diff --git a/ui/litellm-dashboard/src/components/AIHub/ModelCustomMetadata.test.tsx b/ui/litellm-dashboard/src/components/AIHub/ModelCustomMetadata.test.tsx index 5d140a76835..49681154de4 100644 --- a/ui/litellm-dashboard/src/components/AIHub/ModelCustomMetadata.test.tsx +++ b/ui/litellm-dashboard/src/components/AIHub/ModelCustomMetadata.test.tsx @@ -13,9 +13,13 @@ describe("ModelCustomMetadata", () => { expect(screen.getByText("Tags:")).toBeInTheDocument(); expect(screen.getByText("deprecated")).toBeInTheDocument(); expect(screen.getByText("ptu")).toBeInTheDocument(); - expect(screen.getByText("retirement_date").nextElementSibling).toHaveTextContent("2027-03-01"); - expect(screen.getByText("provisioned_ptu").nextElementSibling).toHaveTextContent("100"); - expect(screen.getByText("gsu").nextElementSibling).toHaveTextContent("false"); + const terms = screen.getAllByRole("term").map((term) => term.textContent); + const definitions = screen.getAllByRole("definition").map((definition) => definition.textContent); + expect(terms.map((term, index) => [term, definitions[index]])).toEqual([ + ["retirement_date", "2027-03-01"], + ["provisioned_ptu", "100"], + ["gsu", "false"], + ]); }); it("renders nothing when the model has no tags or metadata", () => {