test max request size

This commit is contained in:
Jack Robison 2019-08-11 23:06:30 -04:00
parent 0ca29b9518
commit aa417f5410
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -265,3 +265,12 @@ class TestBlobExchange(BlobExchangeTestBase):
await asyncio.sleep(0.1, loop=self.loop) await asyncio.sleep(0.1, loop=self.loop)
self.assertIsNone(transport._sock) self.assertIsNone(transport._sock)
self.assertTrue(transport.is_closing()) self.assertTrue(transport.is_closing())
def test_max_request_size(self):
protocol = BlobServerProtocol(self.loop, self.server_blob_manager, 'bQEaw42GXsgCAGio1nxFncJSyRmnztSCjP')
called = asyncio.Event()
protocol.close = called.set
protocol.data_received(b'0' * 1199)
self.assertFalse(called.is_set())
protocol.data_received(b'0')
self.assertTrue(called.is_set())