13 行
599 B
Python
13 行
599 B
Python
from adapters.astrbot_card_renderer import render_help_card, render_status_card
|
|
import pytest
|
|
|
|
|
|
def test_help_and_status_cards_render_png(tmp_path, monkeypatch):
|
|
pytest.importorskip("PIL")
|
|
import adapters.astrbot_card_renderer as renderer
|
|
|
|
monkeypatch.setattr(renderer, "CARD_DIR", tmp_path)
|
|
help_card = render_help_card(["/影棚 帮助", "/yp 状态"])
|
|
status_card = render_status_card(state="正常", version="3.0.0", database="已初始化", api="/api/test")
|
|
assert help_card.read_bytes().startswith(b"\x89PNG")
|
|
assert status_card.read_bytes().startswith(b"\x89PNG")
|