summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2003-03-11 05:04:54 (GMT)
committerBarry Warsaw <barry@python.org>2003-03-11 05:04:54 (GMT)
commitbd757ba1ede53cfda3ceb01d5b5da76d0140a9ab (patch)
tree7e5f4ff737ff48d211aeb8f4630c1f102d4b4b3a
parentcbec700b499a62125a0dd32ef272295cf49c1b8d (diff)
downloadcpython-bd757ba1ede53cfda3ceb01d5b5da76d0140a9ab.zip
cpython-bd757ba1ede53cfda3ceb01d5b5da76d0140a9ab.tar.gz
cpython-bd757ba1ede53cfda3ceb01d5b5da76d0140a9ab.tar.bz2
Adjust tests for no newline appending to MIMEText.__init__()'s _text
argument.
-rw-r--r--Lib/email/test/test_email.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py
index 0b8314e..f580f7d 100644
--- a/Lib/email/test/test_email.py
+++ b/Lib/email/test/test_email.py
@@ -484,21 +484,21 @@ class TestEncoders(unittest.TestCase):
def test_encode_noop(self):
eq = self.assertEqual
msg = MIMEText('hello world', _encoder=Encoders.encode_noop)
- eq(msg.get_payload(), 'hello world\n')
+ eq(msg.get_payload(), 'hello world')
def test_encode_7bit(self):
eq = self.assertEqual
msg = MIMEText('hello world', _encoder=Encoders.encode_7or8bit)
- eq(msg.get_payload(), 'hello world\n')
+ eq(msg.get_payload(), 'hello world')
eq(msg['content-transfer-encoding'], '7bit')
msg = MIMEText('hello \x7f world', _encoder=Encoders.encode_7or8bit)
- eq(msg.get_payload(), 'hello \x7f world\n')
+ eq(msg.get_payload(), 'hello \x7f world')
eq(msg['content-transfer-encoding'], '7bit')
def test_encode_8bit(self):
eq = self.assertEqual
msg = MIMEText('hello \x80 world', _encoder=Encoders.encode_7or8bit)
- eq(msg.get_payload(), 'hello \x80 world\n')
+ eq(msg.get_payload(), 'hello \x80 world')
eq(msg['content-transfer-encoding'], '8bit')
def test_encode_empty_payload(self):
@@ -510,13 +510,13 @@ class TestEncoders(unittest.TestCase):
def test_encode_base64(self):
eq = self.assertEqual
msg = MIMEText('hello world', _encoder=Encoders.encode_base64)
- eq(msg.get_payload(), 'aGVsbG8gd29ybGQK\n')
+ eq(msg.get_payload(), 'aGVsbG8gd29ybGQ=')
eq(msg['content-transfer-encoding'], 'base64')
def test_encode_quoted_printable(self):
eq = self.assertEqual
msg = MIMEText('hello world', _encoder=Encoders.encode_quopri)
- eq(msg.get_payload(), 'hello=20world\n')
+ eq(msg.get_payload(), 'hello=20world')
eq(msg['content-transfer-encoding'], 'quoted-printable')
def test_default_cte(self):
@@ -1005,7 +1005,7 @@ class TestMIMEText(unittest.TestCase):
is missing)
def test_payload(self):
- self.assertEqual(self._msg.get_payload(), 'hello there\n')
+ self.assertEqual(self._msg.get_payload(), 'hello there')
self.failUnless(not self._msg.is_multipart())
def test_charset(self):
@@ -1123,7 +1123,6 @@ MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
hello world
-
--BOUNDARY--
''')
@@ -1151,7 +1150,6 @@ MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
hello world
-
--BOUNDARY--
''')
@@ -1471,14 +1469,12 @@ MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
One
-
--BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Two
-
--BOUNDARY--
""")