source: ogServer-Git/tests/units/0002-post-clients.py @ c39b1f3

Last change on this file since c39b1f3 was c39b1f3, checked in by OpenGnSys Support Team <soporte-og@…>, 5 years ago

#915 add test for POST /clients REST API

  • Property mode set to 100644
File size: 529 bytes
Line 
1import requests
2import unittest
3
4class TestPostClientsMethods(unittest.TestCase):
5
6    def setUp(self):
7        self.url = 'http://localhost:8888/clients'
8        self.json = { 'clients' : [ '192.168.2.1', '192.168.2.2' ] }
9
10    def test_post(self):
11        returned = requests.post(self.url, json=self.json)
12        self.assertEqual(returned.status_code, 200)
13
14    def test_get(self):
15        returned = requests.post(self.url)
16        self.assertEqual(returned.status_code, 404)
17
18if __name__ == '__main__':
19    unittest.main()
Note: See TracBrowser for help on using the repository browser.