Prepare dependency generations before selecting them. Keep shipped tool bytes separate from writable additions, and store facts beside their entries. Validate proposed plugin sets before config publication. Restore the previous config if the facts write fails. Consolidate duplicate updater, backup, setup, and voice helpers. Repair launcher selection, dependency consumers, download ownership, update feeds, and native Windows process and file handling. Verification: 206 changed/prior-failing Python files reported 4630 passed, one failed, and 330 skipped. Fix the remaining Hindsight fixture boundary. The final targeted rerun reported 234 passed and two skipped. The store review regression batch reported 83 passed and one skipped. Desktop TypeScript checks, 56 selected Electron tests, 24 release tests, and the removed-import/compatibility guards passed. This is an integration checkpoint, not full audit acceptance. The complete Python suite has not run on this fixed tree. Crash-atomic plugin publication, generation cleanup, receipt correlation, and packaged lifecycle acceptance remain open in docs/pm-audit-status.md.
22 lines
881 B
Python
22 lines
881 B
Python
"""Managed workspace tooling wins; PATH is only a pre-install fallback."""
|
|
import importlib
|
|
import shutil
|
|
|
|
from pm.workspace import _uv_binary
|
|
|
|
|
|
def test_workspace_uv_prefers_managed_tool_without_path_probe(monkeypatch):
|
|
ensure = importlib.import_module("pm.ensure")
|
|
monkeypatch.setattr(ensure, "uv", lambda **kwargs: ("managed/uv", {}))
|
|
def reject_path(*args, **kwargs):
|
|
raise AssertionError("managed uv must win before PATH")
|
|
monkeypatch.setattr(shutil, "which", reject_path)
|
|
assert _uv_binary() == "managed/uv"
|
|
|
|
|
|
def test_workspace_uv_accepts_developer_path_only_when_store_absent(monkeypatch):
|
|
ensure = importlib.import_module("pm.ensure")
|
|
monkeypatch.setattr(ensure, "uv", lambda **kwargs: (None, {}))
|
|
monkeypatch.setattr(shutil, "which", lambda name: "developer/uv" if name == "uv" else None)
|
|
assert _uv_binary() == "developer/uv"
|