mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-24 00:52:24 +00:00
fix(ui): fix CI failures on upgrade banner PR
Use Annotated[..., Depends(...)] instead of a call in the default value to clear the B008 ruff budget. Extract an inline test object over the no-large-inline-object-arg eslint budget. Mock UpgradeBanner in the layout test, matching the other top banners, since it now renders through react-query hooks that need a QueryClientProvider the test doesn't set up. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
parent
1a358318f8
commit
7edc795831
3 changed files with 9 additions and 6 deletions
|
|
@ -3,7 +3,7 @@ from collections import Counter
|
|||
from collections.abc import Awaitable, Mapping
|
||||
from dataclasses import dataclass
|
||||
from types import MappingProxyType
|
||||
from typing import Final, Literal, Protocol
|
||||
from typing import Annotated, Final, Literal, Protocol
|
||||
|
||||
import httpx
|
||||
from fastapi import APIRouter, Depends
|
||||
|
|
@ -124,8 +124,8 @@ async def get_latest_release_info(
|
|||
response_model=LatestReleaseInfo | None,
|
||||
)
|
||||
async def latest_release_info(
|
||||
client: _AsyncGetClient = Depends(_default_client),
|
||||
cache: InMemoryCache = Depends(_default_cache),
|
||||
client: Annotated[_AsyncGetClient, Depends(_default_client)],
|
||||
cache: Annotated[InMemoryCache, Depends(_default_cache)],
|
||||
) -> LatestReleaseInfo | None:
|
||||
"""
|
||||
Latest stable LiteLLM GitHub release with its PR count split into new features, bug fixes and other updates.
|
||||
|
|
|
|||
|
|
@ -37,6 +37,10 @@ vi.mock("@/components/UserBanner", () => ({
|
|||
UserBanner: () => null,
|
||||
}));
|
||||
|
||||
vi.mock("@/components/UpgradeBanner", () => ({
|
||||
UpgradeBanner: () => null,
|
||||
}));
|
||||
|
||||
vi.mock("@/contexts/ThemeContext", () => ({
|
||||
ThemeProvider: ({ children }: { children: React.ReactNode }) => <>{children}</>,
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -28,9 +28,8 @@ describe("describeRelease", () => {
|
|||
});
|
||||
|
||||
it("singularises counts of one", () => {
|
||||
expect(describeRelease({ ...RELEASE, new_features: 1, bug_fixes: 1, other_updates: 1 })).toBe(
|
||||
"1 new feature, 1 fix, and 1 other update",
|
||||
);
|
||||
const singularCounts = { ...RELEASE, new_features: 1, bug_fixes: 1, other_updates: 1 };
|
||||
expect(describeRelease(singularCounts)).toBe("1 new feature, 1 fix, and 1 other update");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue