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

Method testTimeoutDefault

Lib/test/test_ftplib.py:1090–1100  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1088 self.sock.close()
1089
1090 def testTimeoutDefault(self):
1091 # default -- use global socket timeout
1092 self.assertIsNone(socket.getdefaulttimeout())
1093 socket.setdefaulttimeout(30)
1094 try:
1095 ftp = ftplib.FTP(HOST)
1096 finally:
1097 socket.setdefaulttimeout(None)
1098 self.assertEqual(ftp.sock.gettimeout(), 30)
1099 self.evt.wait()
1100 ftp.close()
1101
1102 def testTimeoutNone(self):
1103 # no timeout -- do not use global socket timeout

Callers

nothing calls this directly

Calls 5

closeMethod · 0.95
assertIsNoneMethod · 0.80
assertEqualMethod · 0.45
gettimeoutMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected