https://github.com/python/cpython/commit/cb72193c8c48a29c6f877863684b9f56f095c7c3
commit: cb72193c8c48a29c6f877863684b9f56f095c7c3
branch: main
author: Mohammad Reza <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2026-05-24T19:50:55+05:30
summary:

gh-150315: increase test coverage for 
`asyncio._FlowControlMixin.set_write_buffer_limits` (#150317)

files:
M Lib/test/test_asyncio/test_transports.py

diff --git a/Lib/test/test_asyncio/test_transports.py 
b/Lib/test/test_asyncio/test_transports.py
index dbb572e2e1536b..1781f1f67753f3 100644
--- a/Lib/test/test_asyncio/test_transports.py
+++ b/Lib/test/test_asyncio/test_transports.py
@@ -98,6 +98,26 @@ 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))
+
 
 if __name__ == '__main__':
     unittest.main()

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to