[Python-checkins] python/dist/src/Lib/email/test test_email.py,1.2,1.3
bwarsaw@users.sourceforge.net
bwarsaw@users.sourceforge.net
Tue, 23 Jul 2002 12:46:38 -0700
Update of /cvsroot/python/python/dist/src/Lib/email/test
In directory usw-pr-cvs1:/tmp/cvs-serv9630
Modified Files:
test_email.py
Log Message:
Added a couple of more tests for Header charset handling.
Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_email.py 23 Jul 2002 19:03:42 -0000 1.2
--- test_email.py 23 Jul 2002 19:46:35 -0000 1.3
***************
*** 2044,2048 ****
--- 2044,2063 ----
eq(h.encode(), hstr)
+ def test_us_ascii_header(self):
+ eq = self.assertEqual
+ s = 'hello'
+ x = decode_header(s)
+ eq(x, [('hello', None)])
+ h = make_header(x)
+ eq(s, h.encode())
+ def test_string_charset(self):
+ eq = self.assertEqual
+ h = Header()
+ h.append('hello', 'iso-8859-1')
+ eq(h, '=?iso-8859-1?q?hello?=')
+
+
+
# Test RFC 2231 header parameters decoding
class TestRFC2231(TestEmailBase):