mirror of
https://github.com/python/cpython.git
synced 2026-01-05 23:12:38 +00:00
Use ndiffAssertEqual in a couple of places for better error reporting.
This commit is contained in:
parent
20ebc37013
commit
e1ff4bbce6
1 changed files with 6 additions and 3 deletions
|
|
@ -1089,6 +1089,7 @@ def test_no_parts_in_a_multipart(self):
|
|||
''')
|
||||
|
||||
def test_one_part_in_a_multipart(self):
|
||||
eq = self.ndiffAssertEqual
|
||||
outer = MIMEBase('multipart', 'mixed')
|
||||
outer['Subject'] = 'A subject'
|
||||
outer['To'] = 'aperson@dom.ain'
|
||||
|
|
@ -1098,7 +1099,7 @@ def test_one_part_in_a_multipart(self):
|
|||
outer.set_boundary('BOUNDARY')
|
||||
msg = MIMEText('hello world')
|
||||
outer.attach(msg)
|
||||
self.assertEqual(outer.as_string(), '''\
|
||||
eq(outer.as_string(), '''\
|
||||
Content-Type: multipart/mixed; boundary="BOUNDARY"
|
||||
MIME-Version: 1.0
|
||||
Subject: A subject
|
||||
|
|
@ -1116,6 +1117,7 @@ def test_one_part_in_a_multipart(self):
|
|||
''')
|
||||
|
||||
def test_seq_parts_in_a_multipart(self):
|
||||
eq = self.ndiffAssertEqual
|
||||
outer = MIMEBase('multipart', 'mixed')
|
||||
outer['Subject'] = 'A subject'
|
||||
outer['To'] = 'aperson@dom.ain'
|
||||
|
|
@ -1125,7 +1127,7 @@ def test_seq_parts_in_a_multipart(self):
|
|||
msg = MIMEText('hello world')
|
||||
outer.attach(msg)
|
||||
outer.set_boundary('BOUNDARY')
|
||||
self.assertEqual(outer.as_string(), '''\
|
||||
eq(outer.as_string(), '''\
|
||||
Content-Type: multipart/mixed; boundary="BOUNDARY"
|
||||
MIME-Version: 1.0
|
||||
Subject: A subject
|
||||
|
|
@ -1410,6 +1412,7 @@ def test_dsn(self):
|
|||
'<002001c144a6$8752e060$56104586@oxy.edu>')
|
||||
|
||||
def test_epilogue(self):
|
||||
eq = self.ndiffAssertEqual
|
||||
fp = openfile('msg_21.txt')
|
||||
try:
|
||||
text = fp.read()
|
||||
|
|
@ -1429,7 +1432,7 @@ def test_epilogue(self):
|
|||
sfp = StringIO()
|
||||
g = Generator(sfp)
|
||||
g.flatten(msg)
|
||||
self.assertEqual(sfp.getvalue(), text)
|
||||
eq(sfp.getvalue(), text)
|
||||
|
||||
def test_no_nl_preamble(self):
|
||||
eq = self.ndiffAssertEqual
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue