diff options
author | Andrei Belov <defan@nginx.com> | 2020-03-12 18:40:48 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2020-03-12 18:40:48 +0300 |
commit | 4b7ca39903178e20ec7381205694cb01f0dec6bc (patch) | |
tree | 51afb9c7003b5927183e7ddecd766eb19e421233 /test/test_settings.py | |
parent | 8414897527ed1616ea39a0cae4d1b8ee170d5cb8 (diff) | |
parent | b3c8a7b33a29208e75dfe4f670cf81dac7b99ccc (diff) | |
download | unit-4b7ca39903178e20ec7381205694cb01f0dec6bc.tar.gz unit-4b7ca39903178e20ec7381205694cb01f0dec6bc.tar.bz2 |
Merged with the default branch.1.16.0-1
Diffstat (limited to '')
-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( |