diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-01-27 21:22:39 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <aneira@soleta.eu> | 2020-01-28 09:14:13 +0100 |
commit | f86999da0c150d2a6976ba69a352164b55c52639 (patch) | |
tree | 3bba6dd489a4268a9c927f272fa99d9064528780 /tests/units/test_0001_probe.py | |
parent | 7196e7198efa6805a566842522c34096bef122a2 (diff) |
add space after Content-Length and Content-Type
ogAdmServer needs this space to work fine.
Diffstat (limited to 'tests/units/test_0001_probe.py')
-rw-r--r-- | tests/units/test_0001_probe.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/units/test_0001_probe.py b/tests/units/test_0001_probe.py index 0f08296..a39ff7d 100644 --- a/tests/units/test_0001_probe.py +++ b/tests/units/test_0001_probe.py @@ -13,8 +13,8 @@ import unittest class TestProbeMethods(unittest.TestCase): def setUp(self): - self.ok_response = 'HTTP/1.0 200 OK\r\nContent-Length:17\r\n' \ - 'Content-Type:application/json\r\n\r\n' + \ + self.ok_response = 'HTTP/1.0 200 OK\r\nContent-Length: 17\r\n' \ + 'Content-Type: application/json\r\n\r\n' + \ '{"status": "OPG"}' def test_post(self): @@ -29,7 +29,7 @@ class TestProbeMethods(unittest.TestCase): c = Client() s = Server() s.connect(probe=False) - s.send('POST /probe HTTP/1.0\r\nContent-Length:0\r\n\r\n') + s.send('POST /probe HTTP/1.0\r\nContent-Length: 0\r\n\r\n') response = s.recv() s.stop() c.stop() @@ -38,8 +38,8 @@ class TestProbeMethods(unittest.TestCase): def test_malformed_json(self): json = '{"id": 0, "name": "test_local", "center": 0}' len_json = str(len(json)) - msg = 'POST /probe HTTP/1.0\r\nContent-Length:' + len_json + \ - '\r\nContent-Type:application/json\r\n\r\n' + json + msg = 'POST /probe HTTP/1.0\r\nContent-Length: ' + len_json + \ + '\r\nContent-Type: application/json\r\n\r\n' + json c = Client() s = Server() s.connect(probe=False) @@ -64,8 +64,8 @@ class TestProbeMethods(unittest.TestCase): json = '{"id": 0, "name": "test_local", "center": 0, "room": 0, ' + \ '"extra_param": true}' len_json = str(len(json)) - msg = 'POST /probe HTTP/1.0\r\nContent-Length:' + len_json + \ - '\r\nContent-Type:application/json\r\n\r\n' + json + msg = 'POST /probe HTTP/1.0\r\nContent-Length: ' + len_json + \ + '\r\nContent-Type: application/json\r\n\r\n' + json c = Client() s = Server() s.connect(probe=False) |