test_feishu.py 414 B

123456789
  1. import json
  2. from data_query_agent.feishu import FeishuLongConnection
  3. def test_parse_text_and_post() -> None:
  4. assert FeishuLongConnection._parse_content(json.dumps({"text": "hello"}), "text") == "hello"
  5. post = {"zh_cn": {"title": "标题", "content": [[{"tag": "text", "text": "内容"}]]}}
  6. assert FeishuLongConnection._parse_content(json.dumps(post, ensure_ascii=False), "post") == "标题\n内容"