-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.py
37 lines (30 loc) · 1.09 KB
/
tests.py
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
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('/gram1?enter=')
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('/gram2?enter=')
self.assertEqual(200, response.status_code)
# testa a pagina para o manual
def test_page_manual(self):
app = myapp.test_client()
response = app.get('/manual')
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()