[Python-checkins] python/dist/src/Lib/test test_bsddb185.py,1.2,1.3

bcannon@users.sourceforge.net bcannon@users.sourceforge.net
Mon, 12 May 2003 23:43:01 -0700


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

Modified Files:
	test_bsddb185.py 
Log Message:
Fixed test_anydbm_creates to use proper paths for the created db.

Made some stylistic fixes.


Index: test_bsddb185.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bsddb185.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_bsddb185.py	6 May 2003 20:37:56 -0000	1.2
--- test_bsddb185.py	13 May 2003 06:42:59 -0000	1.3
***************
*** 1,3 ****
--- 1,8 ----
+ """Tests for the bsddb185 module.
+ 
+ The file 185test.db found in Lib/test/ is for testing purposes with this
+ testing suite.
  
+ """
  from test.test_support import verbose, run_unittest, findfile
  import unittest
***************
*** 9,14 ****
  
  class Bsddb185Tests(unittest.TestCase):
      def test_open_existing_hash(self):
!         "verify we can open a file known to be a hash v2 file"
          db = bsddb185.hashopen(findfile("185test.db"))
          self.assertEqual(db["1"], "1")
--- 14,20 ----
  
  class Bsddb185Tests(unittest.TestCase):
+ 
      def test_open_existing_hash(self):
!         # Verify we can open a file known to be a hash v2 file
          db = bsddb185.hashopen(findfile("185test.db"))
          self.assertEqual(db["1"], "1")
***************
*** 16,30 ****
  
      def test_whichdb(self):
!         "verify that whichdb correctly sniffs the known hash v2 file"
          self.assertEqual(whichdb.whichdb(findfile("185test.db")), "bsddb185")
  
      def test_anydbm_create(self):
!         "verify that anydbm.open does *not* create a bsddb185 file"
          tmpdir = tempfile.mkdtemp()
          try:
              try:
                  dbfile = os.path.join(tmpdir, "foo.db")
!                 anydbm.open(dbfile, "c").close()
!                 ftype = whichdb.whichdb(findfile("foo.db"))
                  self.assertNotEqual(ftype, "bsddb185")
              finally:
--- 22,36 ----
  
      def test_whichdb(self):
!         # Verify that whichdb correctly sniffs the known hash v2 file
          self.assertEqual(whichdb.whichdb(findfile("185test.db")), "bsddb185")
  
      def test_anydbm_create(self):
!         # Verify that anydbm.open does *not* create a bsddb185 file
          tmpdir = tempfile.mkdtemp()
          try:
              try:
                  dbfile = os.path.join(tmpdir, "foo.db")
!                 anydbm.open(os.path.splitext(dbfile)[0], "c").close()
!                 ftype = whichdb.whichdb(dbfile)
                  self.assertNotEqual(ftype, "bsddb185")
              finally: