#915 Fix big request test

ogServer now responses with "413 Payload Too Large" when the payload is
too large.
master
Javier Sánchez Parra 2021-02-23 11:01:53 +01:00 committed by OpenGnSys Support Team
parent f798e03e18
commit 7caffaf56c
1 changed files with 2 additions and 4 deletions

View File

@ -10,10 +10,8 @@ class TestBigRequest(unittest.TestCase):
self.data = 'X' * MAX_REQ_SIZE
def test_post(self):
with self.assertRaises(requests.exceptions.ConnectionError) as context:
requests.post(self.url, data=self.data)
self.assertTrue('Connection reset by peer' in str(context.exception))
returned = requests.post(self.url, data=self.data)
self.assertEqual(returned.status_code, 413)
if __name__ == '__main__':
unittest.main()