Last change
on this file since 3de93a9 was
e397e79,
checked in by OpenGnSys Support Team <soporte-og@…>, 6 years ago
|
#915 add missing brackets to WOL API test json
Without the brackets the call works (200 response) but the ogAdmServer
does not send the WOL packets.
|
-
Property mode set to
100644
|
File size:
699 bytes
|
Rev | Line | |
---|
[556aa6b] | 1 | import requests |
---|
| 2 | import unittest |
---|
| 3 | |
---|
| 4 | class TestPostWolMethods(unittest.TestCase): |
---|
| 5 | |
---|
| 6 | def setUp(self): |
---|
| 7 | self.url = 'http://localhost:8888/wol' |
---|
[eae2385] | 8 | self.headers = {'Authorization' : '07b3bfe728954619b58f0107ad73acc1'} |
---|
[e397e79] | 9 | self.json = { 'type' : 'broadcast', 'clients' : [ { 'addr' : '192.168.2.1', |
---|
| 10 | 'mac' : '00AABBCCDD01' } ] } |
---|
[556aa6b] | 11 | |
---|
| 12 | def test_post(self): |
---|
[eae2385] | 13 | returned = requests.post(self.url, headers=self.headers, json=self.json) |
---|
[556aa6b] | 14 | self.assertEqual(returned.status_code, 200) |
---|
| 15 | |
---|
| 16 | def test_get(self): |
---|
[eae2385] | 17 | returned = requests.post(self.url, headers=self.headers) |
---|
[556aa6b] | 18 | self.assertEqual(returned.status_code, 404) |
---|
| 19 | |
---|
| 20 | if __name__ == '__main__': |
---|
| 21 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.