mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
test(cli-sessions): drop the cwd-relative sys.path.insert hacks
The two new CLI-session test files were added before #37802 swept the suite's sys.path.insert(0, os.path.abspath(...)) calls, so rebasing onto staging put them over the TQ003 test-quality-budget ceiling and failed lint.
This commit is contained in:
parent
b78be07134
commit
217d3f38de
2 changed files with 4 additions and 12 deletions
|
|
@ -1,14 +1,10 @@
|
|||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
import pytest
|
||||
from prisma.engine.errors import EngineConnectionError
|
||||
|
||||
sys.path.insert(0, os.path.abspath("../.."))
|
||||
|
||||
from litellm.caching.dual_cache import DualCache
|
||||
from litellm.caching.in_memory_cache import InMemoryCache
|
||||
from litellm.constants import DEFAULT_IN_MEMORY_TTL
|
||||
|
|
@ -316,9 +312,7 @@ async def test_db_outage_follows_the_proxy_wide_posture(monkeypatch):
|
|||
|
||||
monkeypatch.setattr(proxy_server, "general_settings", {"allow_requests_on_db_unavailable": True}, raising=False)
|
||||
assert (
|
||||
await is_cli_session_revoked(
|
||||
session_token=SESSION_TOKEN, prisma_client=prisma, user_api_key_cache=_cache()
|
||||
)
|
||||
await is_cli_session_revoked(session_token=SESSION_TOKEN, prisma_client=prisma, user_api_key_cache=_cache())
|
||||
is False
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
import os
|
||||
import sys
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from fastapi import HTTPException
|
||||
|
||||
sys.path.insert(0, os.path.abspath("../../../"))
|
||||
|
||||
from litellm.caching.dual_cache import DualCache
|
||||
from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth
|
||||
from litellm.proxy.management_endpoints.cli_session_endpoints import (
|
||||
|
|
@ -109,6 +105,8 @@ async def test_revoking_an_unknown_session_is_a_404():
|
|||
|
||||
with prisma_patch, cache_patch:
|
||||
with pytest.raises(HTTPException) as exc_info:
|
||||
await revoke_cli_session_endpoint(session_id="nope", user_api_key_dict=_caller(LitellmUserRoles.PROXY_ADMIN))
|
||||
await revoke_cli_session_endpoint(
|
||||
session_id="nope", user_api_key_dict=_caller(LitellmUserRoles.PROXY_ADMIN)
|
||||
)
|
||||
|
||||
assert exc_info.value.status_code == 404
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue