修复:CI 部署环境与 ref 错配、迁移碎片化、图片意图 source_span、章节物化脏版式、会话历史与本地语音不一致
新增:TTS 上传 COS 与分片、章节 reading_segments 物化与快照、markdown 清洗、会话消息 repository、语音 store 重构与相关测试
This commit is contained in:
20
api/tests/test_story_backfill.py
Normal file
20
api/tests/test_story_backfill.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import unittest
|
||||
|
||||
from app.features.story.backfill import backfill_image_into_markdown
|
||||
|
||||
|
||||
class StoryBackfillTest(unittest.TestCase):
|
||||
def test_appends_image_at_end_with_prompt_brief_alt(self):
|
||||
md = "第一段\n\n第二段"
|
||||
out = backfill_image_into_markdown(md, "aid-1", "院子里的藤椅")
|
||||
self.assertTrue(out.endswith("](asset://aid-1)\n"))
|
||||
self.assertIn("第二段", out)
|
||||
self.assertLess(out.index("第二段"), out.index("")
|
||||
|
||||
def test_escapes_bracket_in_alt(self):
|
||||
out = backfill_image_into_markdown("正文", "a", "说明]尾")
|
||||
self.assertIn(r"说明\]", out)
|
||||
Reference in New Issue
Block a user