[Python-checkins] python/dist/src/Lib/test test_bsddb.py,1.12,1.13

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Sep 12 00:33:39 EDT 2003


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

Modified Files:
	test_bsddb.py 
Log Message:
SF #662923

Add support for the iterator and mapping protocols.
For Py2.3, this was done for shelve, dumbdbm and other mapping objects, but
not for bsddb and dbhash which were inadvertently missed.



Index: test_bsddb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bsddb.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_bsddb.py	9 Aug 2002 16:37:35 -0000	1.12
--- test_bsddb.py	12 Sep 2003 06:33:37 -0000	1.13
***************
*** 21,30 ****
      if verbose:
          print 'creation...'
!     f['0'] = ''
!     f['a'] = 'Guido'
!     f['b'] = 'van'
!     f['c'] = 'Rossum'
!     f['d'] = 'invented'
!     f['f'] = 'Python'
      if verbose:
          print '%s %s %s' % (f['a'], f['b'], f['c'])
--- 21,42 ----
      if verbose:
          print 'creation...'
!     keys = ['0', 'a', 'b', 'c', 'd', 'e', 'f']
!     values = ['', 'Guido', 'van', 'Rossum', 'invented', 'Python']
!     items = zip(keys, values)
!     for k, v in items:
!         f[k] = v
! 
!     # test mapping iteration methods
!     from sets import Set
!     def verifyset(s1, s2):
!         verify(Set(s1) == Set(s2))
!     verify(keys, f.keys())
!     verify(values, f.values())
!     verify(items, f.items())
!     verify(keys, f)
!     verify(keys, f.iterkeys())
!     verify(values, f.itervalues())
!     verify(items, f.iteritems())
! 
      if verbose:
          print '%s %s %s' % (f['a'], f['b'], f['c'])





More information about the Python-checkins mailing list