beeref/tests/base.py

33 lines
727 B
Python
Raw Normal View History

2021-03-28 09:06:04 +00:00
import os.path
2021-03-22 20:48:05 +00:00
from unittest import TestCase
from PyQt6 import QtWidgets
2021-03-28 09:06:04 +00:00
root = os.path.dirname(__file__)
imgfilename3x3 = os.path.join(root, 'assets', 'test3x3.png')
with open(imgfilename3x3, 'rb') as f:
imgdata3x3 = f.read()
2021-03-22 20:48:05 +00:00
class BeeTestCase(TestCase):
2021-03-28 09:06:04 +00:00
imgfilename3x3 = imgfilename3x3
imgdata3x3 = imgdata3x3
2021-03-22 20:48:05 +00:00
@classmethod
def setUpClass(cls):
2021-04-06 15:34:55 +00:00
inst = QtWidgets.QApplication.instance()
cls.app = inst if inst else QtWidgets.QApplication([])
2021-03-22 20:48:05 +00:00
2021-04-13 15:08:23 +00:00
def queue2list(self, queue):
qlist = []
while not queue.empty():
qlist.append(queue.get())
return qlist
# @classmethod
# def tearDownClass(cls):
# cls.app.quit()
# del cls.app