@@ -14,6 +14,19 @@ def test_plugins_gallery(client):
1414 assert "name" in plugin or "description" in plugin
1515
1616
17+ def test_plugins_gallery_remote_mode (client , monkeypatch ):
18+ """Test that plugins/gallery returns empty list in remote mode (TFL_API_STORAGE_URI is set)"""
19+ # Set TFL_API_STORAGE_URI to enable remote mode
20+ monkeypatch .setenv ("TFL_API_STORAGE_URI" , "true" )
21+
22+ # The endpoint reads env vars at request time, so monkeypatch should work
23+ resp = client .get ("/plugins/gallery" )
24+ assert resp .status_code == 200
25+ data = resp .json ()
26+ assert isinstance (data , list )
27+ assert data == [] # Should return empty list in remote mode
28+
29+
1730def test_plugins_list (client ):
1831 resp = client .get ("/plugins/list" )
1932 assert resp .status_code == 200
@@ -24,6 +37,19 @@ def test_plugins_list(client):
2437 assert "name" in plugin or "description" in plugin
2538
2639
40+ def test_plugins_list_remote_mode (client , monkeypatch ):
41+ """Test that plugins/list returns empty list in remote mode (TFL_API_STORAGE_URI is set)"""
42+ # Set TFL_API_STORAGE_URI to enable remote mode
43+ monkeypatch .setenv ("TFL_API_STORAGE_URI" , "true" )
44+
45+ # The endpoint reads env vars at request time, so monkeypatch should work
46+ resp = client .get ("/plugins/list" )
47+ assert resp .status_code == 200
48+ data = resp .json ()
49+ assert isinstance (data , list )
50+ assert data == [] # Should return empty list in remote mode
51+
52+
2753def test_plugins_install (client ):
2854 resp = client .get ("/plugins/gallery/fastchat_server/install" )
2955 assert resp .status_code in (200 , 404 )
0 commit comments