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))
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'), ])
def test_preserve_freeform(self): self.set_key('----:net.sacredchao.Mutagen:test key', [MP4FreeForm(b'woooo', 142, 42)])
def test_cmp_bytes(self): self.assertReallyEqual(MP4FreeForm(b'woooo'), b"woooo") self.assertReallyNotEqual(MP4FreeForm(b'woooo'), b"foo")
def _convert_to_FreeForm_string(self, tag): tag_in_FreeForm = [ MP4FreeForm(bytes(tag, 'utf8'), dataformat=AtomDataType.UTF8) ] return tag_in_FreeForm
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
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'), ])