示例#1
0
    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)
示例#2
0
 def test_cover_jpeg(self):
     self.set_key('covr', M4ACover('hoooo', M4ACover.FORMAT_JPEG))
示例#3
0
 def test_cover_png(self):
     self.set_key('covr', M4ACover('woooo', M4ACover.FORMAT_PNG))
示例#4
0
 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)]