emmental/audio/test_artwork.py
Anna Schumaker 3a50235c38 audio: Rework the Artwork widget
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>
2021-09-08 10:07:45 -04:00

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)