comparison test/test_multipart.py @ 5035:b5bb492e4b3c

Rename TestMessage to ExampleMessage When py.test is searching for tests it detects TestMessage as a potential class with test cases because it has 'Test' in its name. Because TestMessage contains a __init__ constructor py.test returns a warning that it can't collect tests from it. Lets rename the class to ExampleMessage to avoid this issue.
author John Kristensen <john@jerrykan.com>
date Fri, 21 Aug 2015 17:37:22 +1000
parents 6e3e4f24c753
children 364c54991861
comparison
equal deleted inserted replaced
5034:4ad465b09cbe 5035:b5bb492e4b3c
18 import unittest 18 import unittest
19 from cStringIO import StringIO 19 from cStringIO import StringIO
20 20
21 from roundup.mailgw import Message 21 from roundup.mailgw import Message
22 22
23 class TestMessage(Message): 23 class ExampleMessage(Message):
24 # A note on message/rfc822: The content of such an attachment is an 24 # A note on message/rfc822: The content of such an attachment is an
25 # email with at least one header line. RFC2046 tells us: """ A 25 # email with at least one header line. RFC2046 tells us: """ A
26 # media type of "message/rfc822" indicates that the body contains an 26 # media type of "message/rfc822" indicates that the body contains an
27 # encapsulated message, with the syntax of an RFC 822 message. 27 # encapsulated message, with the syntax of an RFC 822 message.
28 # However, unlike top-level RFC 822 messages, the restriction that 28 # However, unlike top-level RFC 822 messages, the restriction that
158 # end 158 # end
159 p = m.getpart() 159 p = m.getpart()
160 self.assert_(p is None) 160 self.assert_(p is None)
161 161
162 def TestExtraction(self, spec, expected): 162 def TestExtraction(self, spec, expected):
163 self.assertEqual(TestMessage(spec).extract_content(), expected) 163 self.assertEqual(ExampleMessage(spec).extract_content(), expected)
164 164
165 def testTextPlain(self): 165 def testTextPlain(self):
166 self.TestExtraction('text/plain', ('foo\n', [])) 166 self.TestExtraction('text/plain', ('foo\n', []))
167 167
168 def testAttachedTextPlain(self): 168 def testAttachedTextPlain(self):

Roundup Issue Tracker: http://roundup-tracker.org/