Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Lib/test/test_asyncio/test_transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,34 @@ def get_write_buffer_size(self):
self.assertTrue(transport._protocol_paused)
self.assertEqual(transport.get_write_buffer_limits(), (128, 256))

def test_flowcontrol_mixin_compute_write_limits(self):

class MyTransport(transports._FlowControlMixin,
transports.Transport):

def get_write_buffer_size(self):
return 0

loop = mock.Mock()
transport = MyTransport(loop=loop)

self.assertEqual(
transport.get_write_buffer_limits(),
(16 * 1024, 64 * 1024)
)

transport.set_write_buffer_limits(low=100)
self.assertEqual(
transport.get_write_buffer_limits(),
(100, 400)
)

transport.set_write_buffer_limits(high=200)
self.assertEqual(
transport.get_write_buffer_limits(),
(50, 200)
)
Comment on lines +125 to +127
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those lines can be collapsed. It's taking too much vertical space (or are we already exceeding 80 chars in width?)



if __name__ == '__main__':
unittest.main()
Loading