fix: cover API auth guard regressions

Maintainer edit: restore CI by updating serve/onboard tests, add auth/config coverage, and keep auth failures on the OpenAI-compatible error shape.
This commit is contained in:
chengyongru
2026-07-01 13:09:49 +08:00
committed by Xubin Ren
parent 56443ac6e2
commit ed48325346
6 changed files with 75 additions and 9 deletions
+2 -1
View File
@@ -853,10 +853,11 @@ class TestApiServerRegistration:
config = Config()
from nanobot.config.schema import ApiConfig
new_api = ApiConfig(host="0.0.0.0", port=9999)
new_api = ApiConfig(host="0.0.0.0", port=9999, api_key="secret")
_SETTINGS_SETTER["API Server"](config, new_api)
assert config.api.host == "0.0.0.0"
assert config.api.port == 9999
assert config.api.api_key == "secret"
class TestMainMenuUpdate: