File: test_albumart.py

package info (click to toggle)
quodlibet 4.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,228 kB
  • sloc: python: 89,728; sh: 381; xml: 110; makefile: 91
file content (45 lines) | stat: -rw-r--r-- 1,252 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright 2013 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

from quodlibet.formats import AudioFile
from quodlibet.qltk.cover import ALBUM_ART_PLUGIN_ID
from tests.plugin import PluginTestCase

from quodlibet import library, config
from quodlibet import app

A_SONG = AudioFile(
    {"~filename": "/dev/null", "artist": "Mr Man", "album": "Bars of Foo"}
)

# Keep IDEs happy
DownloadAlbumArt = AlbumArtWindow = CoverArea = None


# TODO: Some real tests.
class TAlbumArt(PluginTestCase):
    @classmethod
    def setUpClass(cls):
        app.library = library.init()
        config.init()

    @classmethod
    def tearDownClass(cls):
        config.quit()

    def setUp(self):
        globals().update(vars(self.modules[ALBUM_ART_PLUGIN_ID]))
        self.songs = [A_SONG]
        self.plugin = DownloadAlbumArt(self.songs, library)

    def testAlbumArtWindow(self):
        win = AlbumArtWindow(self.songs)
        win.destroy()

    def testCoverArea(self):
        win = CoverArea(None, self.songs[0])
        win.destroy()