Last change
on this file since 93f1b35 was
f86999d,
checked in by Alvaro Neira Ayuso <aneira@…>, 5 years ago
|
add space after Content-Length and Content-Type
ogAdmServer needs this space to work fine.
|
-
Property mode set to
100644
|
File size:
788 bytes
|
Rev | Line | |
---|
[8a9a32f] | 1 | # |
---|
| 2 | # Copyright (C) 2020 Soleta Networks <info@soleta.eu> |
---|
| 3 | # |
---|
| 4 | # This program is free software: you can redistribute it and/or modify it under |
---|
| 5 | # the terms of the GNU Affero General Public License as published by the |
---|
| 6 | # Free Software Foundation, version 3. |
---|
| 7 | # |
---|
| 8 | |
---|
| 9 | from server import Server |
---|
| 10 | from client import Client |
---|
| 11 | import unittest |
---|
| 12 | |
---|
| 13 | class TestRunScheduleMethods(unittest.TestCase): |
---|
| 14 | |
---|
| 15 | def test_get(self): |
---|
[f86999d] | 16 | req = 'GET /run/schedule HTTP/1.0\r\nContent-Length: 0'+ \ |
---|
| 17 | '\r\nContent-Type: application/json\r\n\r\n' |
---|
[8a9a32f] | 18 | c = Client() |
---|
| 19 | s = Server() |
---|
| 20 | s.connect() |
---|
| 21 | s.send(req) |
---|
| 22 | client_response = s.recv() |
---|
| 23 | s.stop() |
---|
| 24 | c.stop() |
---|
| 25 | self.assertRegex(client_response, '^HTTP/1.0 200 OK\r\n*') |
---|
| 26 | |
---|
| 27 | if __name__ == '__main__': |
---|
| 28 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.