Test WMA support. Cannot add the test file though.
[mussorgsky] / test / aa-spec-test.py
1 #  -*- coding: utf-8 -*-
2 import sys
3 import os
4
5 SRC_DIR = os.path.join(os.path.dirname(__file__), "../src")
6
7 if not SRC_DIR in sys.path:
8     sys.path.insert(0, SRC_DIR)
9 from album_art_spec import getCoverArtFileName
10 from album_art_spec import getCoverArtThumbFileName
11 from album_art_spec import get_thumb_filename_for_path
12
13
14 MAEMO = "/home/ivan/.cache/media-art/album-7215ee9c7d9dc229d2921a40e899ec5f-"
15
16
17 #
18 # This MD5 come from the C library used by MAFW
19 TESTS = [("Absolution", MAEMO + "854b819e796f656947340d8110d13c31.jpeg"),
20          ("Blue & sentimental", MAEMO + "0f6877d9eeb9355ce809eff120dbec11.jpeg"),
21          ("L'orient est rouge", MAEMO + "d570b1a382401ddd5fe31bec72a9fd1b.jpeg"),
22          ("Björk", MAEMO + "39e89a9ca4ab8d6214b240446aeb5cd1.jpeg")]
23
24 for (album, expected_md5) in TESTS:
25
26     cover_art = getCoverArtFileName (album)
27     if cover_art != expected_md5:
28         print "Error album '%s'" % (album)
29         print " Expected: ...%s" % (expected_md5[len(MAEMO)-1:])
30         print " Obtained: ...%s" % (cover_art[len(MAEMO)-1:])
31     else:
32         print "Pass  ('%s')" % (album)