g13gui/g13gui/bitwidgets/label_tests.py
June Tate-Gans ff25e01694 Migrate g13gui out of the g13gui subdir
The whole project at this point is entirely python, with no g13d present
anywhere, so let's clean up the tree somewhat and make it flatter.
2021-05-08 19:47:35 -05:00

31 lines
702 B
Python

import unittest
import time
from g13gui.bitwidgets.display import Display
from g13gui.bitwidgets.x11displaydevice import X11DisplayDevice
from g13gui.bitwidgets.label import Label
class LabelTests(unittest.TestCase):
def setUp(self):
self.dd = X11DisplayDevice(self.__class__.__name__)
self.dd.start()
time.sleep(0.25)
self.d = Display(self.dd)
def tearDown(self):
time.sleep(1)
self.dd.shutdown()
self.dd.join()
def testDraw(self):
label = Label(0, 0, "Hello world!")
ctx = self.d.getContext()
label.show()
label.draw(ctx)
self.d.commit()
if __name__ == '__main__':
unittest.main()