-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
executable file
·30 lines (22 loc) · 1014 Bytes
/
tests.py
File metadata and controls
executable file
·30 lines (22 loc) · 1014 Bytes
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
#!flask/bin/python
import unittest
from requests import get
class TestCase(unittest.TestCase):
def test_get_fashins(self):
response = get('http://localhost:5000/api/fashin')
self.assertEqual(response.status_code, 200)
self.assertNotEqual(response.content, '[]')
def test_get_fashins_empty(self):
response = get('http://localhost:5000/api/fashin?page=10')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, '[]')
def test_get_fashins_specify_page_limit_empty(self):
response = get('http://localhost:5000/api/fashin?page=10&limit=30')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, '[]')
def test_get_fashins_specify_page_limit(self):
response = get('http://localhost:5000/api/fashin?page=2&limit=30')
self.assertEqual(response.status_code, 200)
self.assertNotEqual(response.content, '[]')
if __name__ == '__main__':
unittest.main()