Round 4 fixes: scheduler DB save check, empty validation_targets, proxy list page fallback, scheduler frontend state sync, tests
This commit is contained in:
@@ -164,3 +164,22 @@ class TestSettingsAPI:
|
||||
response = await client.get("/api/settings")
|
||||
saved_settings = response.json()["data"]
|
||||
assert saved_settings["validation_targets"] == test_settings["validation_targets"]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_save_settings_empty_validation_targets(self, client):
|
||||
"""测试保存空的 validation_targets"""
|
||||
response = await client.get("/api/settings")
|
||||
current_settings = response.json()["data"]
|
||||
|
||||
new_settings = current_settings.copy()
|
||||
new_settings["validation_targets"] = []
|
||||
|
||||
response = await client.post("/api/settings", json=new_settings)
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["data"]["validation_targets"] == []
|
||||
|
||||
# 读取确认
|
||||
response = await client.get("/api/settings")
|
||||
saved_settings = response.json()["data"]
|
||||
assert saved_settings["validation_targets"] == []
|
||||
|
||||
Reference in New Issue
Block a user