mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 00:14:09 -04:00
displaydevice: Ensure we start the DBus loop for DeviceManager
This commit is contained in:
parent
83f124bc9c
commit
8390c065fe
@ -1,20 +1,25 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from dbus.mainloop.glib import DBusGMainLoop
|
||||||
|
|
||||||
from g13gui.model.prefs import Preferences
|
from g13gui.model.prefs import Preferences
|
||||||
from g13gui.bitwidgets.display import Display
|
from g13gui.bitwidgets.display import Display
|
||||||
from g13gui.bitwidgets.screen import Screen
|
from g13gui.bitwidgets.screen import Screen
|
||||||
from g13gui.bitwidgets.label import Label
|
from g13gui.bitwidgets.label import Label
|
||||||
|
from g13gui.bitwidgets.rectangle import Rectangle
|
||||||
from g13gui.g13.displaydevice import G13DisplayDevice
|
from g13gui.g13.displaydevice import G13DisplayDevice
|
||||||
from g13gui.g13.manager import Manager
|
from g13gui.g13.manager import DeviceManager
|
||||||
|
from g13gui.bitwidgets import DISPLAY_WIDTH
|
||||||
|
from g13gui.bitwidgets import DISPLAY_HEIGHT
|
||||||
|
|
||||||
|
|
||||||
class DisplayDeviceTests(unittest.TestCase):
|
class DisplayDeviceTests(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.prefs = Preferences()
|
self.prefs = Preferences()
|
||||||
self.manager = Manager(self.prefs)
|
self.manager = DeviceManager(self.prefs)
|
||||||
self.manager.start()
|
self.manager.start()
|
||||||
time.sleep(0.25)
|
time.sleep(1)
|
||||||
self.dd = G13DisplayDevice(self.manager)
|
self.dd = G13DisplayDevice(self.manager)
|
||||||
self.d = Display(self.dd)
|
self.d = Display(self.dd)
|
||||||
self.s = Screen(self.d)
|
self.s = Screen(self.d)
|
||||||
@ -24,11 +29,18 @@ class DisplayDeviceTests(unittest.TestCase):
|
|||||||
self.manager.shutdown()
|
self.manager.shutdown()
|
||||||
|
|
||||||
def testDisplay(self):
|
def testDisplay(self):
|
||||||
|
rect = Rectangle(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT)
|
||||||
|
rect.show()
|
||||||
|
self.s.addChild(rect)
|
||||||
|
|
||||||
label = Label(0, 0, 'Hello, world!')
|
label = Label(0, 0, 'Hello, world!')
|
||||||
label.show()
|
label.show()
|
||||||
self.s.addChild(label)
|
self.s.addChild(label)
|
||||||
|
|
||||||
|
self.s.buttonBar.hide()
|
||||||
self.s.nextFrame()
|
self.s.nextFrame()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
DBusGMainLoop(set_as_default=True)
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user