MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_basics

Method test_basics

Lib/test/test_socketserver.py:380–395  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

378
379class SocketWriterTest(unittest.TestCase):
380 def test_basics(self):
381 class Handler(socketserver.StreamRequestHandler):
382 def handle(self):
383 self.server.wfile = self.wfile
384 self.server.wfile_fileno = self.wfile.fileno()
385 self.server.request_fileno = self.request.fileno()
386
387 server = socketserver.TCPServer((HOST, 0), Handler)
388 self.addCleanup(server.server_close)
389 s = socket.socket(
390 server.address_family, socket.SOCK_STREAM, socket.IPPROTO_TCP)
391 with s:
392 s.connect(server.server_address)
393 server.handle_request()
394 self.assertIsInstance(server.wfile, io.BufferedIOBase)
395 self.assertEqual(server.wfile_fileno, server.request_fileno)
396
397 def test_write(self):
398 # Test that wfile.write() sends data immediately, and that it does

Callers

nothing calls this directly

Calls 6

addCleanupMethod · 0.80
socketMethod · 0.80
assertIsInstanceMethod · 0.80
connectMethod · 0.45
handle_requestMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected