[Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.5,1.6

Barry Warsaw bwarsaw@users.sourceforge.net
Thu, 04 Oct 2001 11:18:39 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv25762

Modified Files:
	test_email.py 
Log Message:
TestIterators: Tim Peters suggests a more succinct spelling of
"listify an iterator".


Index: test_email.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** test_email.py	2001/10/04 17:58:50	1.5
--- test_email.py	2001/10/04 18:18:37	1.6
***************
*** 794,800 ****
          msg = self._msgobj('msg_01.txt')
          it = Iterators.body_line_iterator(msg)
!         lines = []
!         for line in it:
!             lines.append(line)
          eq(len(lines), 6)
          eq(EMPTYSTRING.join(lines), msg.get_payload())
--- 794,798 ----
          msg = self._msgobj('msg_01.txt')
          it = Iterators.body_line_iterator(msg)
!         lines = list(it)
          eq(len(lines), 6)
          eq(EMPTYSTRING.join(lines), msg.get_payload())
***************
*** 802,808 ****
          msg = self._msgobj('msg_02.txt')
          it = Iterators.body_line_iterator(msg)
!         lines = []
!         for line in it:
!             lines.append(line)
          eq(len(lines), 43)
          eq(EMPTYSTRING.join(lines), openfile('msg_19.txt').read())
--- 800,804 ----
          msg = self._msgobj('msg_02.txt')
          it = Iterators.body_line_iterator(msg)
!         lines = list(it)
          eq(len(lines), 43)
          eq(EMPTYSTRING.join(lines), openfile('msg_19.txt').read())
***************
*** 812,821 ****
          msg = self._msgobj('msg_04.txt')
          it = Iterators.typed_subpart_iterator(msg, 'text')
!         lines = []
!         subparts = 0
!         for subpart in it:
!             subparts += 1
!             lines.append(subpart.get_payload())
!         eq(subparts, 2)
          eq(EMPTYSTRING.join(lines), """\
  a simple kind of mirror
--- 808,813 ----
          msg = self._msgobj('msg_04.txt')
          it = Iterators.typed_subpart_iterator(msg, 'text')
!         lines = [subpart.get_payload() for subpart in it]
!         eq(len(lines), 2)
          eq(EMPTYSTRING.join(lines), """\
  a simple kind of mirror