playlist: Create a Model and have it shown by the Selection
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
91ef91a5f0
commit
9d2efcfedd
|
@ -1,8 +1,12 @@
|
|||
# Copyright 2021 (c) Anna Schumaker.
|
||||
from . import column
|
||||
from . import model
|
||||
from gi.repository import Gtk
|
||||
|
||||
Model = model.TagModel()
|
||||
|
||||
Selection = Gtk.SingleSelection()
|
||||
Selection.set_model(Model)
|
||||
|
||||
View = Gtk.ColumnView()
|
||||
View.set_hexpand(True)
|
||||
|
|
|
@ -20,10 +20,12 @@ columns = [ ColumnEV("#", -1, False),
|
|||
|
||||
class TestPlaylist(unittest.TestCase):
|
||||
def test_playlist_init(self):
|
||||
self.assertIsInstance(playlist.Model, playlist.model.TagModel)
|
||||
self.assertIsInstance(playlist.Selection, Gtk.SingleSelection)
|
||||
self.assertIsInstance(playlist.View, Gtk.ColumnView)
|
||||
self.assertIsInstance(playlist.Scroll, Gtk.ScrolledWindow)
|
||||
|
||||
self.assertEqual(playlist.Selection.get_model(), playlist.Model)
|
||||
self.assertEqual(playlist.View.get_model(), playlist.Selection)
|
||||
self.assertEqual(playlist.Scroll.get_child(), playlist.View)
|
||||
|
||||
|
|
Loading…
Reference in New Issue