示例#1
0
 def test_cmp(self):
     self.assertReallyEqual(MP4FreeForm(b'woooo', 142, 42),
                            MP4FreeForm(b'woooo', 142, 42))
     self.assertReallyNotEqual(MP4FreeForm(b'woooo', 142, 43),
                               MP4FreeForm(b'woooo', 142, 42))
     self.assertReallyNotEqual(MP4FreeForm(b'woooo', 143, 42),
                               MP4FreeForm(b'woooo', 142, 42))
     self.assertReallyNotEqual(MP4FreeForm(b'wooox', 142, 42),
                               MP4FreeForm(b'woooo', 142, 42))
示例#2
0
 def test_freeform_bin(self):
     self.set_key('----:net.sacredchao.Mutagen:test key', [
         MP4FreeForm(b'woooo', AtomDataType.UTF8),
         MP4FreeForm(b'hoooo', AtomDataType.IMPLICIT),
         MP4FreeForm(b'boooo'),
     ])
示例#3
0
 def test_preserve_freeform(self):
     self.set_key('----:net.sacredchao.Mutagen:test key',
                  [MP4FreeForm(b'woooo', 142, 42)])
示例#4
0
 def test_cmp_bytes(self):
     self.assertReallyEqual(MP4FreeForm(b'woooo'), b"woooo")
     self.assertReallyNotEqual(MP4FreeForm(b'woooo'), b"foo")
示例#5
0
 def _convert_to_FreeForm_string(self, tag):
     tag_in_FreeForm = [
         MP4FreeForm(bytes(tag, 'utf8'), dataformat=AtomDataType.UTF8)
     ]
     return tag_in_FreeForm
示例#6
0
文件: mp4.py 项目: xeroxcat/music-tag
def freeform_set(afile, norm_key, val):
    ff_vals = [MP4FreeForm(v.encode('utf-8')) for v in val.values]
    afile.mfile.tags[norm_key] = ff_vals
示例#7
0
 def test_freeform_bin(self):
     self.set_key(b'----:net.sacredchao.Mutagen:test key', [
         MP4FreeForm(b'woooo', MP4FreeForm.FORMAT_TEXT),
         MP4FreeForm(b'hoooo', MP4FreeForm.FORMAT_DATA),
         MP4FreeForm(b'boooo'),
     ])