source: ogServer-Git/tests/units/0005-post-shell-output.py @ b35438d

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

#915 add test for POST /shell/output REST API

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