fix/various fixes

This commit is contained in:
Kevin
2026-03-20 15:15:35 +08:00
parent 7f57f96c25
commit 7317bf10cd
112 changed files with 3790 additions and 2242 deletions

View File

@@ -32,6 +32,31 @@ class MemoirImageSchemaTest(unittest.TestCase):
self.assertIsNone(asset)
def test_normalize_image_asset_completed_without_inline_placeholder(self):
asset = normalize_image_asset(
{
"index": 0,
"placeholder": "",
"description": "章节封面",
"status": "completed",
"url": "https://cos.example.com/cover.png",
}
)
self.assertIsNotNone(asset)
self.assertEqual(asset["placeholder"], "")
self.assertEqual(asset["description"], "章节封面")
def test_normalize_image_asset_completed_defaults_description(self):
asset = normalize_image_asset(
{
"status": "completed",
"url": "https://cos.example.com/x.png",
}
)
self.assertIsNotNone(asset)
self.assertEqual(asset["placeholder"], "")
self.assertEqual(asset["description"], "插图")
def test_normalize_image_asset_preserves_retryable_for_failed_assets(self):
asset = normalize_image_asset(
{