[Python-checkins] python/dist/src/Lib/bsddb/test test_recno.py,1.4,1.5

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Fri, 10 Jan 2003 11:28:18 -0800


Update of /cvsroot/python/python/dist/src/Lib/bsddb/test
In directory sc8-pr-cvs1:/tmp/cvs-serv16589

Modified Files:
	test_recno.py 
Log Message:
Python 2.1's string module doesn't have ascii_letters, so let's just
hard code it.  We want this module to work with Python 2.1 for now.


Index: test_recno.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/test/test_recno.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test_recno.py	31 Dec 2002 19:27:45 -0000	1.4
--- test_recno.py	10 Jan 2003 19:28:15 -0000	1.5
***************
*** 1,9 ****
! """
! TestCases for exercising a Recno DB.
  """
  
  import os
  import sys
! import string
  import tempfile
  from pprint import pprint
--- 1,8 ----
! """TestCases for exercising a Recno DB.
  """
  
  import os
  import sys
! import errno
  import tempfile
  from pprint import pprint
***************
*** 11,17 ****
  
  from bsddb import db
- 
  from test_all import verbose
  
  #----------------------------------------------------------------------
  
--- 10,18 ----
  
  from bsddb import db
  from test_all import verbose
  
+ letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ 
+ 
  #----------------------------------------------------------------------
  
***************
*** 23,30 ****
          try:
              os.remove(self.filename)
!         except os.error:
!             pass
! 
! 
  
      def test01_basic(self):
--- 24,29 ----
          try:
              os.remove(self.filename)
!         except OSError, e:
!             if e.errno <> errno.EEXIST: raise
  
      def test01_basic(self):
***************
*** 32,36 ****
          d.open(self.filename, db.DB_RECNO, db.DB_CREATE)
  
!         for x in string.ascii_letters:
              recno = d.append(x * 60)
              assert type(recno) == type(0)
--- 31,35 ----
          d.open(self.filename, db.DB_RECNO, db.DB_CREATE)
  
!         for x in letters:
              recno = d.append(x * 60)
              assert type(recno) == type(0)
***************
*** 78,82 ****
          assert len(keys) == len(d)
  
- 
          items = d.items()
          if verbose:
--- 77,80 ----
***************
*** 165,169 ****
          d.close()
  
- 
      def test02_WithSource(self):
          """
--- 163,166 ----
***************
*** 221,225 ****
               "The quick reddish-brown fox jumped over the comatose dog".split()
  
- 
      def test03_FixedLength(self):
          d = db.DB()
--- 218,221 ----
***************
*** 229,233 ****
          d.open(self.filename, db.DB_RECNO, db.DB_CREATE)
  
!         for x in string.ascii_letters:
              d.append(x * 35)    # These will be padded
  
--- 225,229 ----
          d.open(self.filename, db.DB_RECNO, db.DB_CREATE)
  
!         for x in letters:
              d.append(x * 35)    # These will be padded
  
***************
*** 251,254 ****
--- 247,251 ----
          c.close()
          d.close()
+ 
  
  #----------------------------------------------------------------------