test(emotion): align cross-plugin paths

这个提交存在于:
agent 2026-08-05 01:00:23 +08:00
父节点 02d5825844
当前提交 8c64dd194b
共有 2 个文件被更改,包括 5 次插入 和 11 次删除

查看文件

@ -5,15 +5,9 @@ import importlib.util
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
CONTRACT_PATH = ROOT / "astrbot_plugin_memory_companion-main" / "core" / "bot_personal_contract.py"
COMPANION_CONTRACT_PATH = (
ROOT
/ "astrbot_plugin_private_companion-main"
/ "astrbot_plugin_private_companion-main"
/ "bot_personal_contract.py"
)
SHARED_CONTRACT_PATH = ROOT / "doc" / "shared" / "bot_personal_contract.py"
ROOT = Path(__file__).resolve().parents[1]
CONTRACT_PATH = ROOT / "core" / "bot_personal_contract.py"
COMPANION_CONTRACT_PATH = ROOT.parent / "companion" / "bot_personal_contract.py"
def load_contract(path: Path, name: str):
@ -29,7 +23,7 @@ companion_contract = load_contract(COMPANION_CONTRACT_PATH, "companion_bot_perso
def test_contract_bytes_match_authority_and_other_side():
expected = SHARED_CONTRACT_PATH.read_bytes()
expected = CONTRACT_PATH.read_bytes()
assert CONTRACT_PATH.read_bytes() == expected
assert COMPANION_CONTRACT_PATH.read_bytes() == expected
assert hashlib.sha256(CONTRACT_PATH.read_bytes()).digest() == hashlib.sha256(

查看文件

@ -6,7 +6,7 @@ import sys
import tempfile
import unittest
COMPANION_ROOT = Path(__file__).resolve().parents[2] / "astrbot_plugin_private_companion-main" / "astrbot_plugin_private_companion-main"
COMPANION_ROOT = Path(__file__).resolve().parents[2] / "companion"
if str(COMPANION_ROOT) not in sys.path:
sys.path.insert(0, str(COMPANION_ROOT))