本文整理汇总了Python中mutagen.id3.BitPaddedInt.to_bytes方法的典型用法代码示例。如果您正苦于以下问题:Python BitPaddedInt.to_bytes方法的具体用法?Python BitPaddedInt.to_bytes怎么用?Python BitPaddedInt.to_bytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mutagen.id3.BitPaddedInt
的用法示例。
在下文中一共展示了BitPaddedInt.to_bytes方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_minwidth
# 需要导入模块: from mutagen.id3 import BitPaddedInt [as 别名]
# 或者: from mutagen.id3.BitPaddedInt import to_bytes [as 别名]
def test_minwidth(self):
self.assertEquals(
len(BitPaddedInt.to_bytes(100, width=-1, minwidth=6)), 6)
示例2: test_w129l
# 需要导入模块: from mutagen.id3 import BitPaddedInt [as 别名]
# 或者: from mutagen.id3.BitPaddedInt import to_bytes [as 别名]
def test_w129l(self):
self.assertEquals(
BitPaddedInt.to_bytes(129, width=2, bigendian=False), b'\x01\x01')
示例3: test_varwidth
# 需要导入模块: from mutagen.id3 import BitPaddedInt [as 别名]
# 或者: from mutagen.id3.BitPaddedInt import to_bytes [as 别名]
def test_varwidth(self):
self.assertEquals(len(BitPaddedInt.to_bytes(100)), 4)
self.assertEquals(len(BitPaddedInt.to_bytes(100, width=-1)), 4)
self.assertEquals(len(BitPaddedInt.to_bytes(2**32, width=-1)), 5)
示例4: test_w129
# 需要导入模块: from mutagen.id3 import BitPaddedInt [as 别名]
# 或者: from mutagen.id3.BitPaddedInt import to_bytes [as 别名]
def test_w129(self):
self.assertEquals(BitPaddedInt.to_bytes(129, width=2), b'\x01\x01')
示例5: test_s65
# 需要导入模块: from mutagen.id3 import BitPaddedInt [as 别名]
# 或者: from mutagen.id3.BitPaddedInt import to_bytes [as 别名]
def test_s65(self):
self.assertEquals(BitPaddedInt.to_bytes(0x41, 6), b'\x00\x00\x01\x01')
示例6: test_s129
# 需要导入模块: from mutagen.id3 import BitPaddedInt [as 别名]
# 或者: from mutagen.id3.BitPaddedInt import to_bytes [as 别名]
def test_s129(self):
self.assertEquals(BitPaddedInt.to_bytes(129), b'\x00\x00\x01\x01')
示例7: test_s1l
# 需要导入模块: from mutagen.id3 import BitPaddedInt [as 别名]
# 或者: from mutagen.id3.BitPaddedInt import to_bytes [as 别名]
def test_s1l(self):
self.assertEquals(
BitPaddedInt.to_bytes(1, bigendian=False), b'\x01\x00\x00\x00')
示例8: test_s0
# 需要导入模块: from mutagen.id3 import BitPaddedInt [as 别名]
# 或者: from mutagen.id3.BitPaddedInt import to_bytes [as 别名]
def test_s0(self):
self.assertEquals(BitPaddedInt.to_bytes(0), b'\x00\x00\x00\x00')