Exemplo n.º 1
0
    def test_PIC_upgrade(self):
        from mutagen.id3 import PIC, APIC
        frame = PIC(encoding=0, mime="PNG", desc="bla", type=3, data=b"\x00")
        new = APIC(frame)
        self.assertEqual(new.encoding, 0)
        self.assertEqual(new.mime, "PNG")
        self.assertEqual(new.desc, "bla")
        self.assertEqual(new.data, b"\x00")

        frame = PIC(encoding=0, mime="foo", desc="bla", type=3, data=b"\x00")
        self.assertEqual(frame.mime, "foo")
        new = APIC(frame)
        self.assertEqual(new.mime, "foo")
Exemplo n.º 2
0
 def test_pic(self):
     id3 = ID3()
     id3.version = (2, 2)
     id3.add(PIC(encoding=0, mime="PNG", desc="cover", type=3, data=b""))
     id3.update_to_v24()
     self.failUnlessEqual(id3["APIC:cover"].mime, "image/png")