-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
44 lines (35 loc) · 1.27 KB
/
Copy pathtests.py
File metadata and controls
44 lines (35 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import unittest
from app import myapp
class TestPages(unittest.TestCase):
# testa a pagina principal
def test_page_home(self):
app = myapp.test_client()
response = app.get('/')
self.assertEqual(200, response.status_code)
# testa a pagina para o primeiro exercicio
def test_page_gram1(self):
app = myapp.test_client()
response = app.get('/prova')
self.assertEqual(200, response.status_code)
# testa a pagina para o primeiro exercicio
def test_page_gram1(self):
app = myapp.test_client()
response = app.get('/exe1')
self.assertEqual(200, response.status_code)
# testa a pagina para o segundo exercicio exercicio
def test_page_gram2(self):
app = myapp.test_client()
response = app.get('/exe2')
self.assertEqual(200, response.status_code)
# testa a pagina para o manual
def test_page_manual(self):
app = myapp.test_client()
response = app.get('/exe3')
self.assertEqual(200, response.status_code)
# teste acesso a pagina inexistente
def test_page_fail(self):
app = myapp.test_client()
response = app.get('/fail')
self.assertEqual(404, response.status_code)
if __name__ == '__main__':
unittest.main()