33 行
1.1 KiB
Python
33 行
1.1 KiB
Python
import json
|
|
from pathlib import Path
|
|
|
|
import yaml
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).parents[1]
|
|
|
|
|
|
def test_metadata_contains_required_plugin_fields() -> None:
|
|
metadata = yaml.safe_load(
|
|
(PROJECT_ROOT / "metadata.yaml").read_text(encoding="utf-8")
|
|
)
|
|
|
|
assert metadata["name"] == "astrbot_plugin_moviepilot"
|
|
assert metadata["version"] == "0.16.0"
|
|
assert metadata["astrbot_version"] == ">=4.16,<5"
|
|
assert "aiocqhttp" in metadata["support_platforms"]
|
|
assert "telegram" in metadata["support_platforms"]
|
|
|
|
|
|
def test_config_schema_contains_connection_permissions_and_push_settings() -> None:
|
|
schema = json.loads(
|
|
(PROJECT_ROOT / "_conf_schema.json").read_text(encoding="utf-8")
|
|
)
|
|
|
|
assert schema["moviepilot_url"]["type"] == "string"
|
|
assert schema["moviepilot_api_token"]["type"] == "string"
|
|
assert schema["private_user_ids"]["type"] == "list"
|
|
assert schema["group_permissions"]["type"] == "template_list"
|
|
assert schema["push_group_id"]["type"] == "string"
|
|
assert schema["push_private_user_id"]["type"] == "string"
|
|
assert schema["notification_poll_interval"]["default"] == 60
|