source: ogServer-Git/tests/units/test_0006_post_session.py @ a914462

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

#915 tests correct command, /session

This should test /shell/run instead of /session

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