Back to index

python3.2  3.2.2
Public Member Functions
test.test_smtplib.NonConnectingTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def testNotConnected
def testNonnumericPort

Detailed Description

Definition at line 495 of file test_smtplib.py.


Member Function Documentation

Definition at line 497 of file test_smtplib.py.

00497 
00498     def setUp(self):
00499         smtplib.socket = mock_socket

Here is the caller graph for this function:

Definition at line 500 of file test_smtplib.py.

00500 
00501     def tearDown(self):
00502         smtplib.socket = socket

Here is the caller graph for this function:

Definition at line 513 of file test_smtplib.py.

00513 
00514     def testNonnumericPort(self):
00515         # check that non-numeric port raises socket.error
00516         self.assertRaises(mock_socket.error, smtplib.SMTP,
00517                           "localhost", "bogus")
00518         self.assertRaises(mock_socket.error, smtplib.SMTP,
00519                           "localhost:bogus")
00520 
00521 
00522 # test response of client to a non-successful HELO message
@unittest.skipUnless(threading, 'Threading required for this test.')

Here is the call graph for this function:

Definition at line 503 of file test_smtplib.py.

00503 
00504     def testNotConnected(self):
00505         # Test various operations on an unconnected SMTP object that
00506         # should raise exceptions (at present the attempt in SMTP.send
00507         # to reference the nonexistent 'sock' attribute of the SMTP object
00508         # causes an AttributeError)
00509         smtp = smtplib.SMTP()
00510         self.assertRaises(smtplib.SMTPServerDisconnected, smtp.ehlo)
00511         self.assertRaises(smtplib.SMTPServerDisconnected,
00512                           smtp.send, 'test msg')

Here is the call graph for this function:


The documentation for this class was generated from the following file: