[Python-checkins] CVS: python/dist/src/Lib/test test_ucn.py,1.3,1.4

Fredrik Lundh effbot@users.sourceforge.net
Fri, 19 Jan 2001 01:45:05 -0800


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

Modified Files:
	test_ucn.py 
Log Message:


refactored the unicodeobject/ucnhash interface, to hide the
implementation details inside the ucnhash module.

also cleaned up the unicode copyright blurb a little; Secret Labs'
internal revision history isn't that interesting...


Index: test_ucn.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ucn.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_ucn.py	2001/01/17 19:11:13	1.3
--- test_ucn.py	2001/01/19 09:45:02	1.4
***************
*** 51,70 ****
  # strict error testing:
  print "Testing unicode character name expansion strict error handling....",
- k_cchMaxUnicodeName = 83
- 
- s = "\N{" + "1" * (k_cchMaxUnicodeName + 2) + "}"
  try:
!     unicode(s, 'unicode-escape', 'strict')
  except UnicodeError:
      pass
  else:
!     raise AssertionError, "failed to raise an exception when presented " \
!                           "with a UCN > k_cchMaxUnicodeName"
  try:
!     unicode("\N{blah}", 'unicode-escape', 'strict')
  except UnicodeError:
      pass
  else:
!     raise AssertionError, "failed to raise an exception when given a bogus character name"
  
  try:
--- 51,68 ----
  # strict error testing:
  print "Testing unicode character name expansion strict error handling....",
  try:
!     unicode("\N{blah}", 'unicode-escape', 'strict')
  except UnicodeError:
      pass
  else:
!     raise AssertionError, "failed to raise an exception when given a bogus character name"
! 
  try:
!     unicode("\N{" + "x" * 100000 + "}", 'unicode-escape', 'strict')
  except UnicodeError:
      pass
  else:
!     raise AssertionError, "failed to raise an exception when given a very " \
!                           "long bogus character name"
  
  try: