From 8c64dd194bda16e18fcfa0c8a2ab7c55704a64c5 Mon Sep 17 00:00:00 2001 From: agent Date: Wed, 5 Aug 2026 01:00:23 +0800 Subject: [PATCH] test(emotion): align cross-plugin paths --- tests/test_c1_contract.py | 14 ++++---------- tests/test_c5_bridge_gate.py | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/test_c1_contract.py b/tests/test_c1_contract.py index 45cb5e2..697fd23 100644 --- a/tests/test_c1_contract.py +++ b/tests/test_c1_contract.py @@ -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( diff --git a/tests/test_c5_bridge_gate.py b/tests/test_c5_bridge_gate.py index 165b0e7..4da634d 100644 --- a/tests/test_c5_bridge_gate.py +++ b/tests/test_c5_bridge_gate.py @@ -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))