refactor(image): reuse the model picker

This commit is contained in:
Xubin Ren
2026-07-23 12:42:24 +08:00
parent 8bd951a06f
commit 2f4f00bb9f
4 changed files with 66 additions and 149 deletions
+15
View File
@@ -101,6 +101,21 @@ def test_settings_payload_includes_relocated_capabilities(
assert payload["observability"]["configured"] is True
def test_settings_payload_exposes_modelscope_image_model(
tmp_path,
monkeypatch: pytest.MonkeyPatch,
) -> None:
config_path = tmp_path / "config.json"
save_config(Config(), config_path)
monkeypatch.setattr("nanobot.config.loader._current_config_path", config_path)
payload = settings_payload()
providers = {row["name"]: row for row in payload["image_generation"]["providers"]}
assert providers["modelscope"]["models"] == ["Qwen/Qwen-Image-2512"]
assert providers["modelscope"]["default_model"] == "Qwen/Qwen-Image-2512"
def test_update_api_settings_requires_key_for_network_access(
tmp_path,
monkeypatch: pytest.MonkeyPatch,