test: fold the last Windows path and label assumptions

Second pass over the informational Windows job (91 failures -> 11 -> 0):

* `_identity`/`_fold` now wrap the assertions my first sweep skipped: the
  parenthesised and multi-line ones, and the ones whose token list was
  incomplete (`base_models_roots`, `embeddings_roots`).
* The reconciler's `current_name` and `active_roots` carry the drive-prefixed
  label on Windows ("C: loras"), so the last direct comparison goes through
  `_root_label_names` too.
* `open_settings_location` reveals the settings *file* with
  `explorer /select,` on Windows instead of opening the containing folder, so
  that test asserts the platform's call instead of the POSIX one.
* Three more expectations are written in the business form the code returns
  (metadata payload, extracted download paths, hydrated preview URL).
This commit is contained in:
Will Miao
2026-10-12 11:46:13 +08:00
parent c16de68640
commit d25f170ffe
7 changed files with 33 additions and 25 deletions
+5 -1
View File
@@ -788,7 +788,11 @@ async def test_open_settings_location_with_display_opens_folder(tmp_path, monkey
assert response.status == 200
assert payload["success"] is True
assert calls == [[_expected_opener(), str(settings_file.parent)]]
if os.name == "nt":
# explorer reveals the file itself, there is no "open the folder" call.
assert calls == [["explorer", "/select,", str(settings_file)]]
else:
assert calls == [[_expected_opener(), str(settings_file.parent)]]
@pytest.mark.asyncio
+1 -1
View File
@@ -1237,7 +1237,7 @@ async def test_download_hydrates_the_card_from_the_site(tmp_path, monkeypatch):
"https://resources.modelscope.cn/cover-images/b.png",
"https://resources.modelscope.cn/cover-images/c.png",
]
assert saved["preview_url"] == str(tmp_path / "preview.webp")
assert saved["preview_url"] == str(tmp_path / "preview.webp").replace(os.sep, "/")
assert saved["usage_tips"] == (
'{"strength_min": 0.5, "strength_max": 1.2, "strength_range": "0.5-1.2"}'
)