MCPcopy Index your code
hub / github.com/python/cpython / test_makefile_mode

Method test_makefile_mode

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

Source from the content-addressed store, hash-verified

1919 socket.close(-1)
1920
1921 def test_makefile_mode(self):
1922 for mode in 'r', 'rb', 'rw', 'w', 'wb':
1923 with self.subTest(mode=mode):
1924 with socket.socket() as sock:
1925 encoding = None if "b" in mode else "utf-8"
1926 with sock.makefile(mode, encoding=encoding) as fp:
1927 self.assertEqual(fp.mode, mode)
1928
1929 def test_makefile_invalid_mode(self):
1930 for mode in 'rt', 'x', '+', 'a':

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected