# 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)