test(emotion): align cross-plugin paths
这个提交存在于:
父节点
02d5825844
当前提交
8c64dd194b
共有 2 个文件被更改,包括 5 次插入 和 11 次删除
|
|
@ -5,15 +5,9 @@ import importlib.util
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
ROOT = Path(__file__).resolve().parents[2]
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
CONTRACT_PATH = ROOT / "astrbot_plugin_memory_companion-main" / "core" / "bot_personal_contract.py"
|
CONTRACT_PATH = ROOT / "core" / "bot_personal_contract.py"
|
||||||
COMPANION_CONTRACT_PATH = (
|
COMPANION_CONTRACT_PATH = ROOT.parent / "companion" / "bot_personal_contract.py"
|
||||||
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"
|
|
||||||
|
|
||||||
|
|
||||||
def load_contract(path: Path, name: str):
|
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():
|
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 CONTRACT_PATH.read_bytes() == expected
|
||||||
assert COMPANION_CONTRACT_PATH.read_bytes() == expected
|
assert COMPANION_CONTRACT_PATH.read_bytes() == expected
|
||||||
assert hashlib.sha256(CONTRACT_PATH.read_bytes()).digest() == hashlib.sha256(
|
assert hashlib.sha256(CONTRACT_PATH.read_bytes()).digest() == hashlib.sha256(
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
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:
|
if str(COMPANION_ROOT) not in sys.path:
|
||||||
sys.path.insert(0, str(COMPANION_ROOT))
|
sys.path.insert(0, str(COMPANION_ROOT))
|
||||||
|
|
||||||
|
|
|
||||||
正在加载…
添加表格
在新工单中引用