source: admin/Sources/Services/ogAdmServer/tests/units/0006-post-session.py @ 72d9295

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacion
Last change on this file since 72d9295 was c691949, checked in by OpenGnSys Support Team <soporte-og@…>, 6 years ago

#915 add test for POST /session REST API

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