mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Fix non-root proxy tests
This commit is contained in:
parent
dbe6f66baf
commit
a7bafadd26
1 changed files with 12 additions and 2 deletions
|
|
@ -17,8 +17,13 @@ def test_restructure_ui_html_files_skipped_in_non_root(monkeypatch):
|
|||
ui_path = "/var/lib/litellm/ui"
|
||||
|
||||
# Mock the _restructure_ui_html_files function to check if it's called
|
||||
# Use create=True to allow patching even if the module hasn't been imported yet
|
||||
# or if the function doesn't exist (it's defined inside a try/except block)
|
||||
# spec=False prevents spec checking which can fail during import resolution
|
||||
with patch(
|
||||
"litellm.proxy.proxy_server._restructure_ui_html_files"
|
||||
"litellm.proxy.proxy_server._restructure_ui_html_files",
|
||||
create=True,
|
||||
spec=False,
|
||||
) as mock_restructure:
|
||||
# Simulate the logic we added in proxy_server.py
|
||||
if is_non_root and ui_path == "/var/lib/litellm/ui":
|
||||
|
|
@ -40,8 +45,13 @@ def test_restructure_ui_html_files_NOT_skipped_locally(monkeypatch):
|
|||
is_non_root = False
|
||||
ui_path = "/some/local/path"
|
||||
|
||||
# Use create=True and spec=False to allow patching even if the module hasn't been imported yet
|
||||
# or if the function doesn't exist (it's defined inside a try/except block)
|
||||
# spec=False prevents spec checking which can fail during import resolution
|
||||
with patch(
|
||||
"litellm.proxy.proxy_server._restructure_ui_html_files"
|
||||
"litellm.proxy.proxy_server._restructure_ui_html_files",
|
||||
create=True,
|
||||
spec=False,
|
||||
) as mock_restructure:
|
||||
if is_non_root and ui_path == "/var/lib/litellm/ui":
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue