mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-04 08:28:36 +00:00
test(feishu): cover null post metadata fields
This commit is contained in:
parent
a7cac65c76
commit
30750060ce
@ -42,19 +42,21 @@ def test_extract_interactive_card_reads_table_rows() -> None:
|
|||||||
assert _extract_share_card_content(content, "interactive") == "Name | Score\nAlice | 98"
|
assert _extract_share_card_content(content, "interactive") == "Name | Score\nAlice | 98"
|
||||||
|
|
||||||
|
|
||||||
def test_extract_post_content_tolerates_null_text_fields() -> None:
|
def test_extract_post_content_tolerates_null_fields() -> None:
|
||||||
text, images = _extract_post_content(
|
text, images = _extract_post_content(
|
||||||
{
|
{
|
||||||
"title": "T",
|
"title": None,
|
||||||
"content": [
|
"content": [
|
||||||
[
|
[
|
||||||
{"tag": "text", "text": None},
|
{"tag": "text", "text": None},
|
||||||
{"tag": "a", "text": None},
|
{"tag": "a", "text": None},
|
||||||
|
{"tag": "at", "user_name": None},
|
||||||
{"tag": "text", "text": "ok"},
|
{"tag": "text", "text": "ok"},
|
||||||
{"tag": "code_block", "language": None, "text": None},
|
{"tag": "code_block", "language": None, "text": None},
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
assert "@user" in text
|
||||||
assert "ok" in text
|
assert "ok" in text
|
||||||
assert images == []
|
assert images == []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user