Last change
on this file since 8b7b5f3 was
7caffaf,
checked in by OpenGnSys Support Team <soporte-og@…>, 4 years ago
|
#915 Fix big request test
ogServer now responses with "413 Payload Too Large" when the payload is
too large.
|
-
Property mode set to
100644
|
File size:
394 bytes
|
Rev | Line | |
---|
[784495f] | 1 | import requests |
---|
| 2 | import unittest |
---|
| 3 | |
---|
[0a09c5b] | 4 | MAX_REQ_SIZE = 131072 |
---|
[784495f] | 5 | |
---|
| 6 | class TestBigRequest(unittest.TestCase): |
---|
| 7 | |
---|
| 8 | def setUp(self): |
---|
| 9 | self.url = 'http://localhost:8888/clients' |
---|
| 10 | self.data = 'X' * MAX_REQ_SIZE |
---|
| 11 | |
---|
| 12 | def test_post(self): |
---|
[7caffaf] | 13 | returned = requests.post(self.url, data=self.data) |
---|
| 14 | self.assertEqual(returned.status_code, 413) |
---|
[784495f] | 15 | |
---|
| 16 | if __name__ == '__main__': |
---|
| 17 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.