fix/various fixes
This commit is contained in:
@@ -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(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user