chore/ 删除无用文件
This commit is contained in:
@@ -18,7 +18,9 @@ class MemoirImageBootstrapTest(unittest.TestCase):
|
||||
},
|
||||
)()
|
||||
|
||||
with unittest.mock.patch.dict(os.environ, {"MEMOIR_IMAGE_ENABLED": "false"}, clear=False):
|
||||
with unittest.mock.patch.dict(
|
||||
os.environ, {"MEMOIR_IMAGE_ENABLED": "false"}, clear=False
|
||||
):
|
||||
assets = initialize_chapter_images(chapter)
|
||||
|
||||
self.assertEqual(assets, [])
|
||||
@@ -35,41 +37,69 @@ class MemoirImageBootstrapTest(unittest.TestCase):
|
||||
},
|
||||
)()
|
||||
|
||||
with unittest.mock.patch.dict(os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False):
|
||||
with unittest.mock.patch.dict(
|
||||
os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False
|
||||
):
|
||||
assets = initialize_chapter_images(chapter)
|
||||
|
||||
self.assertEqual(assets, [])
|
||||
|
||||
def test_initialize_chapter_images_preserves_completed_assets_and_adds_only_new_placeholders(self):
|
||||
def test_initialize_chapter_images_preserves_completed_assets_and_adds_only_new_placeholders(
|
||||
self,
|
||||
):
|
||||
"""图片初始化已迁移到 _save_narrative_to_sections;此处为兼容 no-op"""
|
||||
chapter = type("ChapterStub", (), {"id": "chapter-1", "title": "童年的夏天", "category": "childhood"})()
|
||||
chapter = type(
|
||||
"ChapterStub",
|
||||
(),
|
||||
{"id": "chapter-1", "title": "童年的夏天", "category": "childhood"},
|
||||
)()
|
||||
|
||||
with unittest.mock.patch.dict(os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False):
|
||||
with unittest.mock.patch.dict(
|
||||
os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False
|
||||
):
|
||||
assets = initialize_chapter_images(chapter)
|
||||
|
||||
self.assertEqual(assets, [])
|
||||
|
||||
def test_initialize_chapter_images_accepts_double_brace_placeholders(self):
|
||||
"""图片初始化已迁移到 _save_narrative_to_sections;此处为兼容 no-op"""
|
||||
chapter = type("ChapterStub", (), {"id": "chapter-1", "title": "童年的夏天", "category": "childhood"})()
|
||||
chapter = type(
|
||||
"ChapterStub",
|
||||
(),
|
||||
{"id": "chapter-1", "title": "童年的夏天", "category": "childhood"},
|
||||
)()
|
||||
|
||||
with unittest.mock.patch.dict(os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False):
|
||||
with unittest.mock.patch.dict(
|
||||
os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False
|
||||
):
|
||||
assets = initialize_chapter_images(chapter)
|
||||
|
||||
self.assertEqual(assets, [])
|
||||
|
||||
def test_initialize_chapter_images_normalizes_invalid_existing_asset_status(self):
|
||||
"""图片初始化已迁移到 _save_narrative_to_sections;此处为兼容 no-op"""
|
||||
chapter = type("ChapterStub", (), {"id": "chapter-1", "title": "童年的夏天", "category": "childhood"})()
|
||||
chapter = type(
|
||||
"ChapterStub",
|
||||
(),
|
||||
{"id": "chapter-1", "title": "童年的夏天", "category": "childhood"},
|
||||
)()
|
||||
|
||||
with unittest.mock.patch.dict(os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False):
|
||||
with unittest.mock.patch.dict(
|
||||
os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False
|
||||
):
|
||||
assets = initialize_chapter_images(chapter)
|
||||
|
||||
self.assertEqual(assets, [])
|
||||
|
||||
def test_initialize_chapter_images_preserves_existing_completed_assets_beyond_effective_max(self):
|
||||
def test_initialize_chapter_images_preserves_existing_completed_assets_beyond_effective_max(
|
||||
self,
|
||||
):
|
||||
"""图片初始化已迁移到 _save_narrative_to_sections;此处为兼容 no-op"""
|
||||
chapter = type("ChapterStub", (), {"id": "chapter-1", "title": "童年的夏天", "category": "childhood"})()
|
||||
chapter = type(
|
||||
"ChapterStub",
|
||||
(),
|
||||
{"id": "chapter-1", "title": "童年的夏天", "category": "childhood"},
|
||||
)()
|
||||
|
||||
with unittest.mock.patch.dict(
|
||||
os.environ,
|
||||
@@ -82,18 +112,30 @@ class MemoirImageBootstrapTest(unittest.TestCase):
|
||||
|
||||
def test_initialize_chapter_images_increases_limit_for_long_content(self):
|
||||
"""图片初始化已迁移到 _save_narrative_to_sections;此处为兼容 no-op"""
|
||||
chapter = type("ChapterStub", (), {"id": "chapter-1", "title": "童年的夏天", "category": "childhood"})()
|
||||
chapter = type(
|
||||
"ChapterStub",
|
||||
(),
|
||||
{"id": "chapter-1", "title": "童年的夏天", "category": "childhood"},
|
||||
)()
|
||||
|
||||
with unittest.mock.patch.dict(os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False):
|
||||
with unittest.mock.patch.dict(
|
||||
os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False
|
||||
):
|
||||
assets = initialize_chapter_images(chapter)
|
||||
|
||||
self.assertEqual(assets, [])
|
||||
|
||||
def test_initialize_chapter_images_caps_dynamic_limit_at_max_images_cap(self):
|
||||
"""图片初始化已迁移到 _save_narrative_to_sections;此处为兼容 no-op"""
|
||||
chapter = type("ChapterStub", (), {"id": "chapter-1", "title": "童年的夏天", "category": "childhood"})()
|
||||
chapter = type(
|
||||
"ChapterStub",
|
||||
(),
|
||||
{"id": "chapter-1", "title": "童年的夏天", "category": "childhood"},
|
||||
)()
|
||||
|
||||
with unittest.mock.patch.dict(os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False):
|
||||
with unittest.mock.patch.dict(
|
||||
os.environ, {"MEMOIR_IMAGE_ENABLED": "true"}, clear=False
|
||||
):
|
||||
assets = initialize_chapter_images(chapter)
|
||||
|
||||
self.assertEqual(assets, [])
|
||||
|
||||
Reference in New Issue
Block a user