main
This commit is contained in:
parent
be70fea80e
commit
fd6fe7d852
1 changed files with 6 additions and 3 deletions
|
@ -1,8 +1,10 @@
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class UnitTest(unittest.TestCase):
|
class UnitTest(unittest.TestCase):
|
||||||
|
NB_QUESTION = 9
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
from app import app
|
import app
|
||||||
|
app = app.create_app()
|
||||||
app.testing = True
|
app.testing = True
|
||||||
self.app = app.test_client()
|
self.app = app.test_client()
|
||||||
|
|
||||||
|
@ -11,8 +13,9 @@ class UnitTest(unittest.TestCase):
|
||||||
self.assertEqual(rv.status, '200 OK')
|
self.assertEqual(rv.status, '200 OK')
|
||||||
|
|
||||||
def test_play(self):
|
def test_play(self):
|
||||||
rv = self.app.get('/play/TEST')
|
for q in range(NB_QUESTION) :
|
||||||
self.assertEqual(rv.status, '200 OK')
|
rv = self.app.get('/play/TEST/'+str(q))
|
||||||
|
self.assertEqual(rv.status, '200 OK')
|
||||||
|
|
||||||
def test_end(self):
|
def test_end(self):
|
||||||
rv = self.app.get('/end/TEST')
|
rv = self.app.get('/end/TEST')
|
||||||
|
|
Loading…
Reference in a new issue