Anna Schumaker
3a50235c38
It now sets artwork based on the signals sent by the player, allowing us to move it out of the Player class and create instances based on the global Player instead. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
30 lines
985 B
Python
30 lines
985 B
Python
# Copyright 2021 (c) Anna Schumaker.
|
|
import unittest
|
|
from gi.repository import Gtk
|
|
from . import artwork
|
|
|
|
class FakePlayer:
|
|
def __init__(self):
|
|
self.track = None
|
|
def connect(self, name, cb): pass
|
|
|
|
class TestAudioArtwork(unittest.TestCase):
|
|
def test_audio_artwork_init(self):
|
|
fake = FakePlayer()
|
|
art = artwork.Artwork(fake)
|
|
|
|
self.assertIsInstance(art, Gtk.AspectFrame)
|
|
self.assertIsInstance(art.frame, Gtk.Frame)
|
|
self.assertIsInstance(art.picture, Gtk.Picture)
|
|
|
|
self.assertEqual(art.player, fake)
|
|
self.assertEqual(art.get_child(), art.frame)
|
|
self.assertEqual(art.frame.get_child(), art.picture)
|
|
self.assertEqual(art.get_obey_child(), False)
|
|
self.assertEqual(art.get_ratio(), 1.0)
|
|
|
|
self.assertEqual(art.get_margin_start(), 5)
|
|
self.assertEqual(art.get_margin_end(), 5)
|
|
self.assertEqual(art.get_margin_top(), 5)
|
|
self.assertEqual(art.get_margin_bottom(), 5)
|