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):
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue