forked from jleetutorial/dockerapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
23 lines (18 loc) · 727 Bytes
/
test.py
File metadata and controls
23 lines (18 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import unittest
import app
class TestDockerapp(unittest.TestCase):
def setUp(self):
self.app = app.app.test_client()
def test_save_value(self):
response = self.app.post('/', data=dict(submit='save', key='2', cache_value='two'))
assert response.status_code == 200
assert b'2' in response.data
assert b'two' in response.data
def test_load_value(self):
self.app.post('/', data=dict(submit='save', key='2', cache_value='two'))
response = self.app.post('/', data=dict(submit='load', key='2'))
assert response.status_code == 200
assert b'2' in response.data
assert b'two' in response.data
if __name__=='__main__':
unittest.main()