diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2019-09-13 15:18:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-13 15:18:46 +0300 |
commit | 9eb35ab0d71a6bd680e84fa0f828cb634e72b681 (patch) | |
tree | 7f088d5fc06a77bb0450d33a06242e8a32c92794 /Lib/test/test_asyncio/test_transports.py | |
parent | ff2e18286560e981f4e09afb0d2448ea994414d8 (diff) | |
download | cpython-9eb35ab0d71a6bd680e84fa0f828cb634e72b681.tar.gz cpython-9eb35ab0d71a6bd680e84fa0f828cb634e72b681.zip |
bpo-38148: Add slots to asyncio transports (GH-16077)
* bpo-38148: Add slots to asyncio transports
* Update Misc/NEWS.d/next/Library/2019-09-13-08-55-43.bpo-38148.Lnww6D.rst
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Diffstat (limited to 'Lib/test/test_asyncio/test_transports.py')
-rw-r--r-- | Lib/test/test_asyncio/test_transports.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_transports.py b/Lib/test/test_asyncio/test_transports.py index 7de9b3e81a3..df448557a7b 100644 --- a/Lib/test/test_asyncio/test_transports.py +++ b/Lib/test/test_asyncio/test_transports.py @@ -22,14 +22,19 @@ class TransportTests(unittest.TestCase): self.assertIs(default, transport.get_extra_info('unknown', default)) def test_writelines(self): - transport = asyncio.Transport() - transport.write = mock.Mock() + writer = mock.Mock() + + class MyTransport(asyncio.Transport): + def write(self, data): + writer(data) + + transport = MyTransport() transport.writelines([b'line1', bytearray(b'line2'), memoryview(b'line3')]) - self.assertEqual(1, transport.write.call_count) - transport.write.assert_called_with(b'line1line2line3') + self.assertEqual(1, writer.call_count) + writer.assert_called_with(b'line1line2line3') def test_not_implemented(self): transport = asyncio.Transport() |