Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
SecureMailHost.tests.test_messages.TestBuergschaftASCII Class Reference
Inheritance diagram for SecureMailHost.tests.test_messages.TestBuergschaftASCII:
Inheritance graph
[legend]
Collaboration diagram for SecureMailHost.tests.test_messages.TestBuergschaftASCII:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testMessage

Public Attributes

 mailhost

Static Public Attributes

string name = 'buergschaft_latin_msg'
 message = buergschaft_latin1_msg
 out = buergschaft_out
string subject = 'Die Buergschaft'
string charset = 'us-ascii'
string subtype = 'plain'
string mfrom = 'from@example.org'
string mto = 'to@example.org'
string mto_out = 'to@example.org'
 mcc = None
 mbcc = None
dictionary addHeaders = {'Message-Id' : '<1>' }

Detailed Description

Definition at line 95 of file test_messages.py.


Member Function Documentation

Definition at line 47 of file test_messages.py.

00047 
00048     def afterSetUp(self):
00049         self.mailhost = SecureMailBase('securemailhost', '')

Definition at line 50 of file test_messages.py.

00050 
00051     def testMessage(self):
00052         """
00053         """
00054         send = self.mailhost.secureSend
00055         kwargs = self.addHeaders
00056         kwargs['Date'] = DateTime(0).rfc822()
00057         result = send(self.message, self.mto, self.mfrom, subject=self.subject,
00058                       mcc=self.mcc, mbcc = self.mbcc,
00059                       subtype=self.subtype, charset=self.charset,
00060                       debug=True,
00061                       **self.addHeaders)
00062 
00063         self.failUnless(isinstance(result, mail.Mail), 'Result is not a mail.Mail instance')
00064 
00065         mfrom, mto, msg = result.mfrom, result.mto, result.message
00066         self.failUnlessEqual([self.mto_out], mto)
00067         self.failUnlessEqual(self.mfrom, mfrom)
00068         self.failUnless(isinstance(msg, email.Message.Message), 'message is not a email.Message.Message instance')
00069 
00070         msgstr = msg.as_string()
00071 
00072         # compare line by line
00073         outlines = self.out.split('\n')
00074         for i, m in enumerate(msgstr.split('\n')):
00075             if len(outlines) < i:
00076                 self.fail('output has less lines than msg')
00077             o = outlines[i]
00078             self.failUnlessEqual(m, o)
00079 
00080         # compare the complete string 
00081         self.failUnlessEqual(msgstr, self.out)

Here is the call graph for this function:


Member Data Documentation

dictionary SecureMailHost.tests.test_messages.TestMessage.addHeaders = {'Message-Id' : '<1>' } [static, inherited]

Definition at line 45 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMessage.charset = 'us-ascii' [static, inherited]

Definition at line 48 of file test_messages.py.

Definition at line 44 of file test_messages.py.

Definition at line 43 of file test_messages.py.

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 97 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMessage.mfrom = 'from@example.org' [static, inherited]

Definition at line 40 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMessage.mto = 'to@example.org' [static, inherited]
string SecureMailHost.tests.test_messages.TestMessage.mto_out = 'to@example.org' [static, inherited]
string SecureMailHost.tests.test_messages.TestBuergschaftASCII.name = 'buergschaft_latin_msg' [static]

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 96 of file test_messages.py.

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 98 of file test_messages.py.

Reimplemented from SecureMailHost.tests.test_messages.TestMessage.

Definition at line 100 of file test_messages.py.

string SecureMailHost.tests.test_messages.TestMessage.subtype = 'plain' [static, inherited]

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