sidebar: Create a LibraryButtons box
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
59d9c3b484
commit
0014e5fa55
|
@ -0,0 +1,18 @@
|
|||
# Copyright 2021 (c) Anna Schumaker.
|
||||
import db
|
||||
import scanner
|
||||
import unittest
|
||||
from gi.repository import Gtk
|
||||
from . import widgets
|
||||
|
||||
class TestLibraryButtons(unittest.TestCase):
|
||||
def test_init(self):
|
||||
library = db.library.Table.find("/a/b/c")
|
||||
buttons = widgets.LibraryButtons(library)
|
||||
self.assertIsInstance(buttons, Gtk.Box)
|
||||
self.assertTrue(buttons.has_css_class("linked"))
|
||||
|
||||
child = buttons.get_first_child()
|
||||
self.assertIsInstance(child, scanner.widgets.RemoveButton)
|
||||
child = child.get_next_sibling()
|
||||
self.assertIsInstance(child, scanner.widgets.UpdateButton)
|
|
@ -0,0 +1,11 @@
|
|||
# Copyright 2021 (c) Anna Schumaker.
|
||||
import db
|
||||
import scanner
|
||||
from gi.repository import Gtk
|
||||
|
||||
class LibraryButtons(Gtk.Box):
|
||||
def __init__(self, library):
|
||||
Gtk.Box.__init__(self)
|
||||
self.append(scanner.RemoveButton(library))
|
||||
self.append(scanner.UpdateButton(library))
|
||||
self.add_css_class("linked")
|
Loading…
Reference in New Issue