mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-10-12 12:32:11 -03:00
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:
@@ -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
|
||||
|
||||
@@ -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"}'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user