source: ogServer-Git/tests/units/0003-post-wol.py @ 496f5eb

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

#915 add test for POST /wol REST API

  • Property mode set to 100644
File size: 573 bytes
RevLine 
[556aa6b]1import requests
2import unittest
3
4class TestPostWolMethods(unittest.TestCase):
5
6    def setUp(self):
7        self.url = 'http://localhost:8888/wol'
8        self.json = { 'type' : 'broadcast', 'clients' : { 'addr' : '192.168.2.1',
9            'mac' : '00AABBCCDD01' } }
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.