diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2020-02-20 20:33:49 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2020-02-20 20:33:49 +0000 |
commit | fcca366392ff42e1addfac958da70c3e5375fc35 (patch) | |
tree | 31f0c6d78a7a8e28ebfd4f4a296be99a9829578f /test/test_settings.py | |
parent | d198a105eb9a49749fa38fe8eba4da59d572292e (diff) | |
download | unit-fcca366392ff42e1addfac958da70c3e5375fc35.tar.gz unit-fcca366392ff42e1addfac958da70c3e5375fc35.tar.bz2 |
Tests: more tests with "max_body_size".
Diffstat (limited to 'test/test_settings.py')
-rw-r--r-- | test/test_settings.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test_settings.py b/test/test_settings.py index 6b849558..9de3a928 100644 --- a/test/test_settings.py +++ b/test/test_settings.py @@ -215,6 +215,31 @@ Connection: close self.post(body='012345')['status'], 413, 'status size max' ) + def test_settings_max_body_size_large(self): + self.load('mirror') + + self.conf({'http': {'max_body_size': 32 * 1024 * 1024}}, 'settings') + + body = '0123456789abcdef' * 4 * 64 * 1024 + resp = self.post(body=body, read_buffer_size=1024 * 1024) + self.assertEqual(resp['status'], 200, 'status size 4') + self.assertEqual(resp['body'], body, 'status body 4') + + body = '0123456789abcdef' * 8 * 64 * 1024 + resp = self.post(body=body, read_buffer_size=1024 * 1024) + self.assertEqual(resp['status'], 200, 'status size 8') + self.assertEqual(resp['body'], body, 'status body 8') + + body = '0123456789abcdef' * 16 * 64 * 1024 + resp = self.post(body=body, read_buffer_size=1024 * 1024) + self.assertEqual(resp['status'], 200, 'status size 16') + self.assertEqual(resp['body'], body, 'status body 16') + + body = '0123456789abcdef' * 32 * 64 * 1024 + resp = self.post(body=body, read_buffer_size=1024 * 1024) + self.assertEqual(resp['status'], 200, 'status size 32') + self.assertEqual(resp['body'], body, 'status body 32') + @unittest.skip('not yet') def test_settings_negative_value(self): self.assertIn( |