Fix UI test server import.
This commit is contained in:
parent
f09dfac4f2
commit
a1ff139dd8
2 changed files with 7 additions and 2 deletions
|
@ -12,6 +12,9 @@ class BAPSicleServer():
|
|||
def __del__(self):
|
||||
stopServer()
|
||||
|
||||
def get_flask(self):
|
||||
return app
|
||||
|
||||
|
||||
app = Flask(__name__, static_url_path='')
|
||||
|
||||
|
@ -168,6 +171,7 @@ def stopServer():
|
|||
q.put("QUIT")
|
||||
for player in channel_p:
|
||||
player.join()
|
||||
global app
|
||||
app = None
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from bapsicle import server
|
||||
from server import BAPSicleServer
|
||||
import unittest
|
||||
|
||||
|
||||
|
@ -19,7 +19,8 @@ class TestUI(unittest.TestCase):
|
|||
# initialization logic
|
||||
# code that is executed before each test
|
||||
def setUp(self):
|
||||
self.app = server.app.test_client()
|
||||
server = BAPSicleServer()
|
||||
self.app = server.get_flask().test_client()
|
||||
self.app.testing = True
|
||||
|
||||
# clean up logic
|
||||
|
|
Loading…
Reference in a new issue