mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-31 13:07:56 +08:00
refactor: normalize capability module paths
This commit is contained in:
@@ -367,7 +367,7 @@ def _activate_agent_scenario(
|
||||
def _read_display_runtime() -> dict[str, object]:
|
||||
"""读取 host.display 的只读状态和观测,不触发资源激活。"""
|
||||
try:
|
||||
from app.runtime.managed_resources import (
|
||||
from app.runtime.resources import (
|
||||
managed_resource_observations,
|
||||
managed_resource_snapshot,
|
||||
)
|
||||
|
||||
@@ -14,7 +14,6 @@ from types import ModuleType, SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
PERF_DIR = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
@@ -651,7 +650,7 @@ def test_sitecustomize_serializes_managed_resource_facade(monkeypatch) -> None:
|
||||
error=None,
|
||||
)
|
||||
|
||||
facade = ModuleType("app.runtime.managed_resources")
|
||||
facade = ModuleType("app.runtime.resources")
|
||||
|
||||
def managed_resource_snapshot(capability_id: str):
|
||||
assert capability_id == "host.display"
|
||||
@@ -663,7 +662,7 @@ def test_sitecustomize_serializes_managed_resource_facade(monkeypatch) -> None:
|
||||
|
||||
facade.managed_resource_snapshot = managed_resource_snapshot
|
||||
facade.managed_resource_observations = managed_resource_observations
|
||||
monkeypatch.setitem(sys.modules, "app.runtime.managed_resources", facade)
|
||||
monkeypatch.setitem(sys.modules, "app.runtime.resources", facade)
|
||||
probe = load_module(
|
||||
"moviepilot_perf_sitecustomize_observation",
|
||||
PERF_DIR / "instrument" / "sitecustomize.py",
|
||||
|
||||
Reference in New Issue
Block a user