summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-08-25 22:23:23 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-08-25 22:23:23 (GMT)
commit54c69c2fe3a6d9489407e751ea61c6c2dee1e9e5 (patch)
tree89dd71b35ff5642e26cefe25c76ab9f17b1f25dc /Lib
parent83b9ea4942692efcb8d3eeab200c62b6a98208fb (diff)
parent52bb949fd3658957fb8719fd83183b38d9fb621c (diff)
downloadcpython-54c69c2fe3a6d9489407e751ea61c6c2dee1e9e5.zip
cpython-54c69c2fe3a6d9489407e751ea61c6c2dee1e9e5.tar.gz
cpython-54c69c2fe3a6d9489407e751ea61c6c2dee1e9e5.tar.bz2
(Merge 3.4) asyncio, tulip issue 203: Add _FlowControlMixin.get_write_buffer_limits()
method
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/transports.py3
-rw-r--r--Lib/test/test_asyncio/test_transports.py2
2 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py
index 5f674f9..3caf853 100644
--- a/Lib/asyncio/transports.py
+++ b/Lib/asyncio/transports.py
@@ -273,6 +273,9 @@ class _FlowControlMixin(Transport):
'protocol': self._protocol,
})
+ def get_write_buffer_limits(self):
+ return (self._low_water, self._high_water)
+
def _set_write_buffer_limits(self, high=None, low=None):
if high is None:
if low is None:
diff --git a/Lib/test/test_asyncio/test_transports.py b/Lib/test/test_asyncio/test_transports.py
index cfbdf3e..5be1b7b 100644
--- a/Lib/test/test_asyncio/test_transports.py
+++ b/Lib/test/test_asyncio/test_transports.py
@@ -79,9 +79,11 @@ class TransportTests(unittest.TestCase):
transport.set_write_buffer_limits(high=1024, low=128)
self.assertFalse(transport._protocol_paused)
+ self.assertEqual(transport.get_write_buffer_limits(), (128, 1024))
transport.set_write_buffer_limits(high=256, low=128)
self.assertTrue(transport._protocol_paused)
+ self.assertEqual(transport.get_write_buffer_limits(), (128, 256))
if __name__ == '__main__':