Fix UI test server import.

This commit is contained in:
Matthew Stratford 2020-10-26 21:25:02 +00:00
parent f09dfac4f2
commit a1ff139dd8
No known key found for this signature in database
GPG key ID: 5F50E4308A3416E8
2 changed files with 7 additions and 2 deletions

View file

@ -12,6 +12,9 @@ class BAPSicleServer():
def __del__(self): def __del__(self):
stopServer() stopServer()
def get_flask(self):
return app
app = Flask(__name__, static_url_path='') app = Flask(__name__, static_url_path='')
@ -168,6 +171,7 @@ def stopServer():
q.put("QUIT") q.put("QUIT")
for player in channel_p: for player in channel_p:
player.join() player.join()
global app
app = None app = None

View file

@ -1,4 +1,4 @@
from bapsicle import server from server import BAPSicleServer
import unittest import unittest
@ -19,7 +19,8 @@ class TestUI(unittest.TestCase):
# initialization logic # initialization logic
# code that is executed before each test # code that is executed before each test
def setUp(self): def setUp(self):
self.app = server.app.test_client() server = BAPSicleServer()
self.app = server.get_flask().test_client()
self.app.testing = True self.app.testing = True
# clean up logic # clean up logic