Last change
on this file was
1472ff2,
checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago
|
#915 add test POST /client/delete
|
-
Property mode set to
100644
|
File size:
840 bytes
|
Line | |
---|
1 | import requests |
---|
2 | import unittest |
---|
3 | |
---|
4 | class TestPostClientDeleteMethods(unittest.TestCase): |
---|
5 | |
---|
6 | def setUp(self): |
---|
7 | self.url = 'http://localhost:8888/client/delete' |
---|
8 | self.headers = {'Authorization' : '07b3bfe728954619b58f0107ad73acc1'} |
---|
9 | self.json = { "clients": ["192.168.56.30"] } |
---|
10 | |
---|
11 | def test_post(self): |
---|
12 | returned = requests.post(self.url, headers=self.headers, json=self.json) |
---|
13 | self.assertEqual(returned.status_code, 200) |
---|
14 | |
---|
15 | def test_post_no_payload(self): |
---|
16 | returned = requests.post(self.url, headers=self.headers, json=None) |
---|
17 | self.assertEqual(returned.status_code, 400) |
---|
18 | |
---|
19 | def test_post_malformed_payload(self): |
---|
20 | returned = requests.post(self.url, headers=self.headers, json={}) |
---|
21 | self.assertEqual(returned.status_code, 400) |
---|
22 | |
---|
23 | |
---|
24 | if __name__ == '__main__': |
---|
25 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.