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

Method test_makefile_mode

Lib/test/test_socket.py:1870–1876  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1868 socket.close(-1)
1869
1870 def test_makefile_mode(self):
1871 for mode in 'r', 'rb', 'rw', 'w', 'wb':
1872 with self.subTest(mode=mode):
1873 with socket.socket() as sock:
1874 encoding = None if "b" in mode else "utf-8"
1875 with sock.makefile(mode, encoding=encoding) as fp:
1876 self.assertEqual(fp.mode, mode)
1877
1878 def test_makefile_invalid_mode(self):
1879 for mode in 'rt', 'x', '+', 'a':

Callers

nothing calls this directly

Calls 4

subTestMethod · 0.80
socketMethod · 0.80
makefileMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected