本文整理汇总了Python中mutagen.flac.Picture._invalid_overflow_size方法的典型用法代码示例。如果您正苦于以下问题:Python Picture._invalid_overflow_size方法的具体用法?Python Picture._invalid_overflow_size怎么用?Python Picture._invalid_overflow_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mutagen.flac.Picture
的用法示例。
在下文中一共展示了Picture._invalid_overflow_size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_invalid_overflow_recover_and_save_back
# 需要导入模块: from mutagen.flac import Picture [as 别名]
# 或者: from mutagen.flac.Picture import _invalid_overflow_size [as 别名]
def test_invalid_overflow_recover_and_save_back(self):
# save a picture which is too large for flac, but still write it
# with a wrong block size
f = FLAC(self.filename)
f.clear_pictures()
pic = Picture()
pic.data = b"\x00" * (2 ** 24 - 32)
pic._invalid_overflow_size = 42
f.add_picture(pic)
f.save()
# make sure we can read it and save it again
f = FLAC(self.filename)
self.assertTrue(f.pictures)
self.assertEqual(len(f.pictures[0].data), 2 ** 24 - 32)
f.save()