[Python-checkins] CVS: python/dist/src/Lib/test string_tests.py,1.4,1.5 test_charmapcodec.py,1.3,1.4 test_crypt.py,1.5,1.6 test_format.py,1.7,1.8 test_sax.py,1.15,1.16 test_support.py,1.10,1.11 test_unicode.py,1.27,1.28 test_xreadline.py,1.2,1.3 testcodec.py,1.1,1.2

Tim Peters tim_one@users.sourceforge.net
Wed, 17 Jan 2001 18:22:24 -0800


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

Modified Files:
	string_tests.py test_charmapcodec.py test_crypt.py 
	test_format.py test_sax.py test_support.py test_unicode.py 
	test_xreadline.py testcodec.py 
Log Message:
Whitespace normalization.  Leaving tokenize_tests.py alone for now.


Index: string_tests.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/string_tests.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** string_tests.py	2001/01/16 11:54:11	1.4
--- string_tests.py	2001/01/18 02:22:22	1.5
***************
*** 57,61 ****
      test('count', 'aaa', 3, 'a')
      test('count', 'aaa', 0, 'b')
!     
      test('find', 'abcdefghiabc', 0, 'abc')
      test('find', 'abcdefghiabc', 9, 'abc', 1)
--- 57,61 ----
      test('count', 'aaa', 3, 'a')
      test('count', 'aaa', 0, 'b')
! 
      test('find', 'abcdefghiabc', 0, 'abc')
      test('find', 'abcdefghiabc', 9, 'abc', 1)

Index: test_charmapcodec.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_charmapcodec.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_charmapcodec.py	2001/01/17 15:07:00	1.3
--- test_charmapcodec.py	2001/01/18 02:22:22	1.4
***************
*** 18,22 ****
  # test codec's full path name (see test/testcodec.py)
  codecname = 'test.testcodec'
!     
  check(unicode('abc', codecname), u'abc')
  check(unicode('xdef', codecname), u'abcdef')
--- 18,22 ----
  # test codec's full path name (see test/testcodec.py)
  codecname = 'test.testcodec'
! 
  check(unicode('abc', codecname), u'abc')
  check(unicode('xdef', codecname), u'abcdef')
***************
*** 42,44 ****
  else:
      print '*** check failed: \\001 does not map to undefined'
-     
--- 42,43 ----

Index: test_crypt.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_crypt.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** test_crypt.py	2001/01/17 19:11:13	1.5
--- test_crypt.py	2001/01/18 02:22:22	1.6
***************
*** 4,8 ****
  """
  
! from test_support import verify, verbose    
  import crypt
  
--- 4,8 ----
  """
  
! from test_support import verify, verbose
  import crypt
  

Index: test_format.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_format.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** test_format.py	2001/01/17 21:51:35	1.7
--- test_format.py	2001/01/18 02:22:22	1.8
***************
*** 199,201 ****
  test_exc(u'abc %\u3000', 1, ValueError,
           "unsupported format character '?' (0x3000) at index 5")
- 
--- 199,200 ----

Index: test_sax.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sax.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** test_sax.py	2001/01/17 19:11:13	1.15
--- test_sax.py	2001/01/18 02:22:22	1.16
***************
*** 31,35 ****
  
  def test_make_parser2():
!     try:       
          # Creating parsers several times in a row should succeed.
          # Testing this because there have been failures of this kind
--- 31,35 ----
  
  def test_make_parser2():
!     try:
          # Creating parsers several times in a row should succeed.
          # Testing this because there have been failures of this kind
***************
*** 51,56 ****
      else:
          return p
!     
!         
  # ===========================================================================
  #
--- 51,56 ----
      else:
          return p
! 
! 
  # ===========================================================================
  #
***************
*** 398,402 ****
      return parser.getSystemId() is None and \
             parser.getPublicId() is None and \
!            parser.getLineNumber() == 1 
  
  def test_expat_locator_withinfo():
--- 398,402 ----
      return parser.getSystemId() is None and \
             parser.getPublicId() is None and \
!            parser.getLineNumber() == 1
  
  def test_expat_locator_withinfo():

Index: test_support.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** test_support.py	2001/01/17 19:11:13	1.10
--- test_support.py	2001/01/18 02:22:22	1.11
***************
*** 74,85 ****
  
  def verify(condition, reason='test failed'):
- 	
- 	""" Verify that condition is true. If not, raise an
- 	    AssertionError.
  
! 	    The optinal argument reason can be given to provide
! 	    a better error text.
! 	
! 	"""
! 	if not condition:
! 		raise AssertionError,reason
--- 74,85 ----
  
  def verify(condition, reason='test failed'):
  
!     """ Verify that condition is true. If not, raise an
!         AssertionError.
! 
!         The optinal argument reason can be given to provide
!         a better error text.
! 
!     """
!     if not condition:
!         raise AssertionError,reason

Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** test_unicode.py	2001/01/17 19:11:13	1.27
--- test_unicode.py	2001/01/18 02:22:22	1.28
***************
*** 196,200 ****
      # Non surrogate above surrogate value, fixup required
      def test_lecmp(s, s2):
!       verify(s <  s2 , "comparison failed on %s < %s" % (s, s2))
  
      def test_fixup(s):
--- 196,200 ----
      # Non surrogate above surrogate value, fixup required
      def test_lecmp(s, s2):
!         verify(s <  s2 , "comparison failed on %s < %s" % (s, s2))
  
      def test_fixup(s):
***************
*** 373,381 ****
         ''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))) )
  # UTF-8 specific decoding tests
! verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))), 
                 'utf-8') == u'\ud84d\udc56' )
! verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))), 
                 'utf-8') == u'\ud800\udc02' )
! verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))), 
                 'utf-8') == u'\u20ac' )
  
--- 373,381 ----
         ''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))) )
  # UTF-8 specific decoding tests
! verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))),
                 'utf-8') == u'\ud84d\udc56' )
! verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))),
                 'utf-8') == u'\ud800\udc02' )
! verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))),
                 'utf-8') == u'\u20ac' )
  
***************
*** 502,506 ****
      'cp863', 'cp865', 'cp866',
      'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
!     'iso8859_2', 'iso8859_4', 'iso8859_5', 
      'iso8859_9', 'koi8_r', 'latin_1',
      'mac_cyrillic', 'mac_latin2',
--- 502,506 ----
      'cp863', 'cp865', 'cp866',
      'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
!     'iso8859_2', 'iso8859_4', 'iso8859_5',
      'iso8859_9', 'koi8_r', 'latin_1',
      'mac_cyrillic', 'mac_latin2',
***************
*** 510,514 ****
      #'cp1256', 'cp1257', 'cp1258',
      #'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874',
!     #'iso8859_3', 'iso8859_6', 'iso8859_7', 
      #'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
  
--- 510,514 ----
      #'cp1256', 'cp1257', 'cp1258',
      #'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874',
!     #'iso8859_3', 'iso8859_6', 'iso8859_7',
      #'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish',
  

Index: test_xreadline.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_xreadline.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_xreadline.py	2001/01/09 23:26:39	1.2
--- test_xreadline.py	2001/01/18 02:22:22	1.3
***************
*** 2,11 ****
  
  class XReader:
! 	def __init__(self):
! 		self.count = 5
  
! 	def readlines(self, sizehint = None):
! 		self.count = self.count - 1
! 		return map(lambda x: "%d\n" % x, range(self.count))
  
  class Null: pass
--- 2,11 ----
  
  class XReader:
!     def __init__(self):
!         self.count = 5
  
!     def readlines(self, sizehint = None):
!         self.count = self.count - 1
!         return map(lambda x: "%d\n" % x, range(self.count))
  
  class Null: pass
***************
*** 17,43 ****
  
  try:
! 	xreadlines.xreadlines(Null())[0]
  except AttributeError, detail:
! 	print "AttributeError (expected)"
  else:
! 	print "Did not throw attribute error"
  
  try:
! 	xreadlines.xreadlines(XReader)[0]
  except TypeError, detail:
! 	print "TypeError (expected)"
  else:
! 	print "Did not throw type error"
  
  try:
! 	xreadlines.xreadlines(XReader())[1]
  except RuntimeError, detail:
! 	print "RuntimeError (expected):", detail
  else:
! 	print "Did not throw runtime error"
  
  xresult = ['0\n', '1\n', '2\n', '3\n', '0\n', '1\n', '2\n', '0\n', '1\n', '0\n']
  for line in xreadlines.xreadlines(XReader()):
! 	if line != xresult[lineno]:
! 	    print "line %d differs" % lineno
! 	lineno += 1
--- 17,43 ----
  
  try:
!     xreadlines.xreadlines(Null())[0]
  except AttributeError, detail:
!     print "AttributeError (expected)"
  else:
!     print "Did not throw attribute error"
  
  try:
!     xreadlines.xreadlines(XReader)[0]
  except TypeError, detail:
!     print "TypeError (expected)"
  else:
!     print "Did not throw type error"
  
  try:
!     xreadlines.xreadlines(XReader())[1]
  except RuntimeError, detail:
!     print "RuntimeError (expected):", detail
  else:
!     print "Did not throw runtime error"
  
  xresult = ['0\n', '1\n', '2\n', '3\n', '0\n', '1\n', '2\n', '0\n', '1\n', '0\n']
  for line in xreadlines.xreadlines(XReader()):
!     if line != xresult[lineno]:
!         print "line %d differs" % lineno
!     lineno += 1

Index: testcodec.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/testcodec.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** testcodec.py	2001/01/10 10:21:10	1.1
--- testcodec.py	2001/01/18 02:22:22	1.2
***************
*** 15,19 ****
  
          return codecs.charmap_encode(input,errors,encoding_map)
!         
      def decode(self,input,errors='strict'):
  
--- 15,19 ----
  
          return codecs.charmap_encode(input,errors,encoding_map)
! 
      def decode(self,input,errors='strict'):
  
***************
*** 22,26 ****
  class StreamWriter(Codec,codecs.StreamWriter):
      pass
!         
  class StreamReader(Codec,codecs.StreamReader):
      pass
--- 22,26 ----
  class StreamWriter(Codec,codecs.StreamWriter):
      pass
! 
  class StreamReader(Codec,codecs.StreamReader):
      pass
***************
*** 47,49 ****
  for k,v in decoding_map.items():
      encoding_map[v] = k
- 
--- 47,48 ----