mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Rename Transport.pause/resume to pause_reading/pause_writing. Also relax timeout in test_call_later().
This commit is contained in:
parent
40b22d0661
commit
57497ad181
10 changed files with 33 additions and 33 deletions
|
|
@ -308,7 +308,7 @@ class ProactorSocketTransportTests(unittest.TestCase):
|
|||
tr.write_eof()
|
||||
tr.close()
|
||||
|
||||
def test_pause_resume(self):
|
||||
def test_pause_resume_reading(self):
|
||||
tr = _ProactorSocketTransport(
|
||||
self.loop, self.sock, self.protocol)
|
||||
futures = []
|
||||
|
|
@ -323,12 +323,12 @@ class ProactorSocketTransportTests(unittest.TestCase):
|
|||
self.protocol.data_received.assert_called_with(b'data1')
|
||||
self.loop._run_once()
|
||||
self.protocol.data_received.assert_called_with(b'data2')
|
||||
tr.pause()
|
||||
tr.pause_reading()
|
||||
self.assertTrue(tr._paused)
|
||||
for i in range(10):
|
||||
self.loop._run_once()
|
||||
self.protocol.data_received.assert_called_with(b'data2')
|
||||
tr.resume()
|
||||
tr.resume_reading()
|
||||
self.assertFalse(tr._paused)
|
||||
self.loop._run_once()
|
||||
self.protocol.data_received.assert_called_with(b'data3')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue