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

Method testTimeoutDefault

Lib/test/test_smtplib.py:107–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

105 client.close()
106
107 def testTimeoutDefault(self):
108 mock_socket.reply_with(b"220 Hola mundo")
109 self.assertIsNone(mock_socket.getdefaulttimeout())
110 mock_socket.setdefaulttimeout(30)
111 self.assertEqual(mock_socket.getdefaulttimeout(), 30)
112 try:
113 client = self.client(HOST, self.port)
114 finally:
115 mock_socket.setdefaulttimeout(None)
116 self.assertEqual(client.sock.gettimeout(), 30)
117 client.close()
118
119 def testTimeoutNone(self):
120 mock_socket.reply_with(b"220 Hola mundo")

Callers

nothing calls this directly

Calls 5

assertIsNoneMethod · 0.80
assertEqualMethod · 0.45
clientMethod · 0.45
gettimeoutMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected