Browse Source

add test.py in main

Auriane Lartigue 2 years ago
parent
commit
23779029ba
1 changed files with 27 additions and 0 deletions
  1. 27
    0
      main/Dockerfiles/app/App/app/test.py

+ 27
- 0
main/Dockerfiles/app/App/app/test.py View File

@@ -0,0 +1,27 @@
1
+import unittest
2
+from app import app
3
+
4
+class UnitTest(unittest.TestCase):
5
+	def setUp(self):
6
+		app.testing = True
7
+		self.app = app.test_client()
8
+
9
+	def test_homepage(self):
10
+		rv = self.app.get('/')
11
+		self.assertEqual(rv.status, '200 OK')
12
+
13
+	def test_play(self):
14
+		rv = self.app.get('/play/TEST')
15
+		self.assertEqual(rv.status, '200 OK')
16
+
17
+  	def test_end(self):
18
+		rv = self.app.get('/end/TEST')
19
+                self.assertEqual(rv.status, '200 OK')
20
+
21
+	def test_lost(self):
22
+		rv = self.app.get('/lost/TEST')
23
+		self.assertEqual(rv.status,'200 OK')
24
+
25
+if __name__ == '__main__':
26
+		unittest.main()
27
+		

Loading…
Cancel
Save