|
@@ -1,8 +1,10 @@
|
1
|
1
|
import unittest
|
2
|
2
|
|
3
|
3
|
class UnitTest(unittest.TestCase):
|
|
4
|
+ NB_QUESTION = 9
|
4
|
5
|
def setUp(self):
|
5
|
|
- from app import app
|
|
6
|
+ import app
|
|
7
|
+ app = app.create_app()
|
6
|
8
|
app.testing = True
|
7
|
9
|
self.app = app.test_client()
|
8
|
10
|
|
|
@@ -11,8 +13,9 @@ class UnitTest(unittest.TestCase):
|
11
|
13
|
self.assertEqual(rv.status, '200 OK')
|
12
|
14
|
|
13
|
15
|
def test_play(self):
|
14
|
|
- rv = self.app.get('/play/TEST')
|
15
|
|
- self.assertEqual(rv.status, '200 OK')
|
|
16
|
+ for q in range(NB_QUESTION) :
|
|
17
|
+ rv = self.app.get('/play/TEST/'+str(q))
|
|
18
|
+ self.assertEqual(rv.status, '200 OK')
|
16
|
19
|
|
17
|
20
|
def test_end(self):
|
18
|
21
|
rv = self.app.get('/end/TEST')
|