PATH: //proc/thread-self/root/opt/alt/python311/lib64/python3.11/test/test_asyncio
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📄 __main__.py
↓
X
📁 __pycache__/
X
📄 echo.py
↓
X
📄 echo2.py
↓
X
📄 echo3.py
↓
X
📄 functional.py
↓
X
📄 test_base_events.py
↓
X
📄 test_buffered_proto.py
↓
X
📄 test_context.py
↓
X
📄 test_events.py
↓
X
📄 test_futures.py
↓
X
📄 test_futures2.py
↓
X
📄 test_locks.py
↓
X
📄 test_pep492.py
↓
X
📄 test_proactor_events.py
↓
X
📄 test_protocols.py
↓
X
📄 test_queues.py
↓
X
📄 test_runners.py
↓
X
📄 test_selector_events.py
↓
X
📄 test_sendfile.py
↓
X
📄 test_server.py
↓
X
📄 test_sock_lowlevel.py
↓
X
📄 test_ssl.py
↓
X
📄 test_sslproto.py
↓
X
📄 test_streams.py
↓
X
📄 test_subprocess.py
↓
X
📄 test_taskgroups.py
↓
X
📄 test_tasks.py
↓
X
📄 test_threads.py
↓
X
📄 test_timeouts.py
↓
X
📄 test_transports.py
↓
X
📄 test_unix_events.py
↓
X
📄 test_waitfor.py
↓
X
📄 test_windows_events.py
↓
X
📄 test_windows_utils.py
↓
X
📄 utils.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: test_protocols.py
import unittest from unittest import mock import asyncio def tearDownModule(): # not needed for the test file but added for uniformness with all other # asyncio test files for the sake of unified cleanup asyncio.set_event_loop_policy(None) class ProtocolsAbsTests(unittest.TestCase): def test_base_protocol(self): f = mock.Mock() p = asyncio.BaseProtocol() self.assertIsNone(p.connection_made(f)) self.assertIsNone(p.connection_lost(f)) self.assertIsNone(p.pause_writing()) self.assertIsNone(p.resume_writing()) self.assertFalse(hasattr(p, '__dict__')) def test_protocol(self): f = mock.Mock() p = asyncio.Protocol() self.assertIsNone(p.connection_made(f)) self.assertIsNone(p.connection_lost(f)) self.assertIsNone(p.data_received(f)) self.assertIsNone(p.eof_received()) self.assertIsNone(p.pause_writing()) self.assertIsNone(p.resume_writing()) self.assertFalse(hasattr(p, '__dict__')) def test_buffered_protocol(self): f = mock.Mock() p = asyncio.BufferedProtocol() self.assertIsNone(p.connection_made(f)) self.assertIsNone(p.connection_lost(f)) self.assertIsNone(p.get_buffer(100)) self.assertIsNone(p.buffer_updated(150)) self.assertIsNone(p.pause_writing()) self.assertIsNone(p.resume_writing()) self.assertFalse(hasattr(p, '__dict__')) def test_datagram_protocol(self): f = mock.Mock() dp = asyncio.DatagramProtocol() self.assertIsNone(dp.connection_made(f)) self.assertIsNone(dp.connection_lost(f)) self.assertIsNone(dp.error_received(f)) self.assertIsNone(dp.datagram_received(f, f)) self.assertFalse(hasattr(dp, '__dict__')) def test_subprocess_protocol(self): f = mock.Mock() sp = asyncio.SubprocessProtocol() self.assertIsNone(sp.connection_made(f)) self.assertIsNone(sp.connection_lost(f)) self.assertIsNone(sp.pipe_data_received(1, f)) self.assertIsNone(sp.pipe_connection_lost(1, f)) self.assertIsNone(sp.process_exited()) self.assertFalse(hasattr(sp, '__dict__')) if __name__ == '__main__': unittest.main()
SIMPAN PERUBAHAN