def test_fail(self): self.assertRaises(error, M4A, self.SOME_FILE) self.assertRaises(error, delete, self.SOME_FILE) self.assertRaises(error, delete, self.SOME_FILE) M4AInfo # flake8 with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) a = M4A() a.add_tags() self.assertEqual(a.tags.items(), []) some_cover = M4ACover(b"foo", M4ACover.FORMAT_JPEG) self.assertEqual(some_cover.imageformat, M4ACover.FORMAT_JPEG) tags = M4ATags() self.assertRaises(error, tags.save, self.SOME_FILE)
def test_cover_jpeg(self): self.set_key('covr', M4ACover('hoooo', M4ACover.FORMAT_JPEG))
def test_cover_png(self): self.set_key('covr', M4ACover('woooo', M4ACover.FORMAT_PNG))
def embed_art(self, art_path): artworkfile = open(art_path, 'rb').read() format = M4ACover.FORMAT_PNG if art_path.endswith('png') else M4ACover.FORMAT_JPEG self.audio.tags['covr'] = [M4ACover(artworkfile, format)]