add test.py in main
This commit is contained in:
parent
b45f977914
commit
23779029ba
1 changed files with 27 additions and 0 deletions
27
main/Dockerfiles/app/App/app/test.py
Normal file
27
main/Dockerfiles/app/App/app/test.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
import unittest
|
||||
from app import app
|
||||
|
||||
class UnitTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
app.testing = True
|
||||
self.app = app.test_client()
|
||||
|
||||
def test_homepage(self):
|
||||
rv = self.app.get('/')
|
||||
self.assertEqual(rv.status, '200 OK')
|
||||
|
||||
def test_play(self):
|
||||
rv = self.app.get('/play/TEST')
|
||||
self.assertEqual(rv.status, '200 OK')
|
||||
|
||||
def test_end(self):
|
||||
rv = self.app.get('/end/TEST')
|
||||
self.assertEqual(rv.status, '200 OK')
|
||||
|
||||
def test_lost(self):
|
||||
rv = self.app.get('/lost/TEST')
|
||||
self.assertEqual(rv.status,'200 OK')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
Reference in a new issue