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

Method testSurrogateescapeBind

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

Source from the content-addressed store, hash-verified

6334 self.assertEqual(self.sock.getsockname(), path)
6335
6336 def testSurrogateescapeBind(self):
6337 # Test binding to a valid non-ASCII pathname, with the
6338 # non-ASCII bytes supplied using surrogateescape encoding.
6339 path = os.path.abspath(os_helper.TESTFN_UNICODE)
6340 b = self.encoded(path)
6341 self.bind(self.sock, b.decode("ascii", "surrogateescape"))
6342 self.addCleanup(os_helper.unlink, path)
6343 self.assertEqual(self.sock.getsockname(), path)
6344
6345 def testUnencodableAddr(self):
6346 # Test binding to a pathname that cannot be encoded in the

Callers

nothing calls this directly

Calls 7

encodedMethod · 0.95
bindMethod · 0.95
addCleanupMethod · 0.80
abspathMethod · 0.45
decodeMethod · 0.45
assertEqualMethod · 0.45
getsocknameMethod · 0.45

Tested by

no test coverage detected