[Python-checkins] python/dist/src/Lib/email/test test_email.py,1.27,1.28
bwarsaw@users.sourceforge.net
bwarsaw@users.sourceforge.net
Mon, 30 Dec 2002 11:14:40 -0800
Update of /cvsroot/python/python/dist/src/Lib/email/test
In directory sc8-pr-cvs1:/tmp/cvs-serv20714
Modified Files:
test_email.py
Log Message:
test_bad_8bit_header(): Tests for optional argument `errors'. See SF
bug #648119.
Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** test_email.py 30 Dec 2002 17:45:02 -0000 1.27
--- test_email.py 30 Dec 2002 19:14:38 -0000 1.28
***************
*** 2308,2311 ****
--- 2308,2322 ----
eq(h.encode(), '=?utf-8?b?6I+K5Zyw5pmC5aSr?=')
+ def test_bad_8bit_header(self):
+ raises = self.assertRaises
+ eq = self.assertEqual
+ x = 'Ynwp4dUEbay Auction Semiar- No Charge \x96 Earn Big'
+ raises(UnicodeError, Header, x)
+ h = Header()
+ raises(UnicodeError, h.append, x)
+ eq(str(Header(x, errors='replace')), x)
+ h.append(x, errors='replace')
+ eq(str(h), x)
+