diff options
author | Guido van Rossum <guido@python.org> | 2006-08-21 00:21:47 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-08-21 00:21:47 (GMT) |
commit | 2043513bd584a08cc7d748562bd8011b989b3659 (patch) | |
tree | a2f33ad9469d3aa1bfb32fa6e003f7e24dc6af7e /Lib/bsddb/test/test_basics.py | |
parent | f1a69c16665c6c031c4723e5bc3e6d6f4118fa5e (diff) | |
download | cpython-2043513bd584a08cc7d748562bd8011b989b3659.zip cpython-2043513bd584a08cc7d748562bd8011b989b3659.tar.gz cpython-2043513bd584a08cc7d748562bd8011b989b3659.tar.bz2 |
Fixed to the point that all unit tests pass again. (However, I get 4
"exception in thread" messages, one about a killed locker, and three
assertions.) Details:
test/test_dbshelve.py:
- kill reference to InstanceType
test/test_basics.py:
- use // for int division
- use 'in' instead of has_key
dbshelve.py:
- fix bug in previous has_key fix, use self.db.has_key instead of self.has_key
dbtables.py:
- use 'in' instead of has_key
dbutils.py:
- fix bug in previous has_key fix, test for 'max_retries', not 'max_tries'
Diffstat (limited to 'Lib/bsddb/test/test_basics.py')
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index f7f4c2d..7e6ba52 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -114,14 +114,14 @@ class BasicTestCase(unittest.TestCase): def populateDB(self, _txn=None): d = self.d - for x in range(self._numKeys/2): + for x in range(self._numKeys//2): key = '%04d' % (self._numKeys - x) # insert keys in reverse order data = self.makeData(key) d.put(key, data, _txn) d.put('empty value', '', _txn) - for x in range(self._numKeys/2-1): + for x in range(self._numKeys//2-1): key = '%04d' % x # and now some in forward order data = self.makeData(key) d.put(key, data, _txn) @@ -686,10 +686,10 @@ class BasicTransactionTestCase(BasicTestCase): if db.version() >= (4,0): statDict = self.env.log_stat(0); - assert statDict.has_key('magic') - assert statDict.has_key('version') - assert statDict.has_key('cur_file') - assert statDict.has_key('region_nowait') + assert 'magic' in statDict + assert 'version' in statDict + assert 'cur_file' in statDict + assert 'region_nowait' in statDict # must have at least one log file present: logs = self.env.log_archive(db.DB_ARCH_ABS | db.DB_ARCH_LOG) |