summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/test
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-04-17 08:48:32 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-04-17 08:48:32 (GMT)
commit9d72bb452bced3a100f07f8a9e30c4495a9ec41a (patch)
treec39762a764fcc16f2cfc42e2504e58ff31e159e6 /Lib/bsddb/test
parentff11334927ee616d765b54a3851016b76a20bcec (diff)
downloadcpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.zip
cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.tar.gz
cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.tar.bz2
Remove functions in string module that are also string methods. Also remove:
* all calls to functions in the string module (except maketrans) * everything from stropmodule except for maketrans() which is still used
Diffstat (limited to 'Lib/bsddb/test')
-rw-r--r--Lib/bsddb/test/test_associate.py12
-rw-r--r--Lib/bsddb/test/test_compat.py4
-rw-r--r--Lib/bsddb/test/test_dbobj.py4
-rw-r--r--Lib/bsddb/test/test_join.py2
-rw-r--r--Lib/bsddb/test/test_lock.py2
-rw-r--r--Lib/bsddb/test/test_pickle.py2
6 files changed, 13 insertions, 13 deletions
diff --git a/Lib/bsddb/test/test_associate.py b/Lib/bsddb/test/test_associate.py
index 857cd3d..d8c9c0c 100644
--- a/Lib/bsddb/test/test_associate.py
+++ b/Lib/bsddb/test/test_associate.py
@@ -2,7 +2,7 @@
TestCases for DB.associate.
"""
-import sys, os, string
+import sys, os
import tempfile
import time
from pprint import pprint
@@ -177,7 +177,7 @@ class AssociateTestCase(unittest.TestCase):
for key, value in musicdata.items():
if type(self.keytype) == type(''):
key = "%02d" % key
- d.put(key, string.join(value, '|'), txn=txn)
+ d.put(key, '|'.join(value), txn=txn)
def createDB(self, txn=None):
self.cur = None
@@ -263,7 +263,7 @@ class AssociateTestCase(unittest.TestCase):
rec = self.cur.first()
while rec is not None:
if type(self.keytype) == type(''):
- assert string.atoi(rec[0]) # for primary db, key is a number
+ assert int(rec[0]) # for primary db, key is a number
else:
assert rec[0] and type(rec[0]) == type(0)
count = count + 1
@@ -305,7 +305,7 @@ class AssociateTestCase(unittest.TestCase):
assert type(priData) == type("")
if verbose:
print('getGenre key: %r data: %r' % (priKey, priData))
- genre = string.split(priData, '|')[2]
+ genre = priData.split('|')[2]
if genre == 'Blues':
return db.DB_DONOTINDEX
else:
@@ -427,13 +427,13 @@ class ThreadedAssociateTestCase(AssociateTestCase):
for key, value in musicdata.items():
if type(self.keytype) == type(''):
key = "%02d" % key
- d.put(key, string.join(value, '|'))
+ d.put(key, '|'.join(value))
def writer2(self, d):
for x in range(100, 600):
key = 'z%2d' % x
value = [key] * 4
- d.put(key, string.join(value, '|'))
+ d.put(key, '|'.join(value))
class ThreadedAssociateHashTestCase(ShelveAssociateTestCase):
diff --git a/Lib/bsddb/test/test_compat.py b/Lib/bsddb/test/test_compat.py
index 7561f9f..2908844 100644
--- a/Lib/bsddb/test/test_compat.py
+++ b/Lib/bsddb/test/test_compat.py
@@ -3,7 +3,7 @@ Test cases adapted from the test_bsddb.py module in Python's
regression test suite.
"""
-import sys, os, string
+import sys, os
import unittest
import tempfile
@@ -35,7 +35,7 @@ class CompatibilityTestCase(unittest.TestCase):
self.do_bthash_test(hashopen, 'hashopen')
def test03_rnopen(self):
- data = string.split("The quick brown fox jumped over the lazy dog.")
+ data = "The quick brown fox jumped over the lazy dog.".split()
if verbose:
print("\nTesting: rnopen")
diff --git a/Lib/bsddb/test/test_dbobj.py b/Lib/bsddb/test/test_dbobj.py
index b15de2f..27fffe0 100644
--- a/Lib/bsddb/test/test_dbobj.py
+++ b/Lib/bsddb/test/test_dbobj.py
@@ -1,5 +1,5 @@
-import sys, os, string
+import sys, os
import unittest
import glob
import tempfile
@@ -38,7 +38,7 @@ class dbobjTestCase(unittest.TestCase):
class TestDBEnv(dbobj.DBEnv): pass
class TestDB(dbobj.DB):
def put(self, key, *args, **kwargs):
- key = string.upper(key)
+ key = key.upper()
# call our parent classes put method with an upper case key
return dbobj.DB.put(self, key, *args, **kwargs)
self.env = TestDBEnv()
diff --git a/Lib/bsddb/test/test_join.py b/Lib/bsddb/test/test_join.py
index 67507ea..00e7479 100644
--- a/Lib/bsddb/test/test_join.py
+++ b/Lib/bsddb/test/test_join.py
@@ -1,7 +1,7 @@
"""TestCases for using the DB.join and DBCursor.join_item methods.
"""
-import sys, os, string
+import sys, os
import tempfile
import time
from pprint import pprint
diff --git a/Lib/bsddb/test/test_lock.py b/Lib/bsddb/test/test_lock.py
index e44bf21..9b5a71f 100644
--- a/Lib/bsddb/test/test_lock.py
+++ b/Lib/bsddb/test/test_lock.py
@@ -2,7 +2,7 @@
TestCases for testing the locking sub-system.
"""
-import sys, os, string
+import sys, os
import tempfile
import time
from pprint import pprint
diff --git a/Lib/bsddb/test/test_pickle.py b/Lib/bsddb/test/test_pickle.py
index 4683ec6..95cb23d 100644
--- a/Lib/bsddb/test/test_pickle.py
+++ b/Lib/bsddb/test/test_pickle.py
@@ -1,5 +1,5 @@
-import sys, os, string
+import sys, os
import pickle
try:
import cPickle