mirror of
https://github.com/python/cpython.git
synced 2025-10-23 07:02:24 +00:00
Eat some low hanging fruit... let the test suite run.
This commit is contained in:
parent
ea03c11655
commit
0e6012cbf3
4 changed files with 12 additions and 7 deletions
|
@ -23,7 +23,7 @@ except ImportError:
|
||||||
from .test_all import verbose
|
from .test_all import verbose
|
||||||
|
|
||||||
DASH = b'-'
|
DASH = b'-'
|
||||||
|
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -886,7 +886,7 @@ class BasicMultiDBTestCase(BasicTestCase):
|
||||||
x = x.encode("ascii")
|
x = x.encode("ascii")
|
||||||
d2.put(x, self.makeData(x))
|
d2.put(x, self.makeData(x))
|
||||||
|
|
||||||
for x in string.letters:
|
for x in letters:
|
||||||
x = x.encode("ascii")
|
x = x.encode("ascii")
|
||||||
d3.put(x, x*70)
|
d3.put(x, x*70)
|
||||||
|
|
||||||
|
@ -942,6 +942,7 @@ class BasicMultiDBTestCase(BasicTestCase):
|
||||||
c2.close()
|
c2.close()
|
||||||
c3.close()
|
c3.close()
|
||||||
|
|
||||||
|
d1.close()
|
||||||
d2.close()
|
d2.close()
|
||||||
d3.close()
|
d3.close()
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ class DataClass:
|
||||||
other = other.value
|
other = other.value
|
||||||
return value < other
|
return value < other
|
||||||
|
|
||||||
|
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
|
|
||||||
class DBShelveTestCase(unittest.TestCase):
|
class DBShelveTestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.filename = tempfile.mktemp()
|
self.filename = tempfile.mktemp()
|
||||||
|
@ -50,7 +52,7 @@ class DBShelveTestCase(unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def populateDB(self, d):
|
def populateDB(self, d):
|
||||||
for x in string.letters:
|
for x in letters:
|
||||||
d[('S' + x).encode("ascii")] = 10 * x # add a string
|
d[('S' + x).encode("ascii")] = 10 * x # add a string
|
||||||
d[('I' + x).encode("ascii")] = ord(x) # add an integer
|
d[('I' + x).encode("ascii")] = ord(x) # add an integer
|
||||||
d[('L' + x).encode("ascii")] = [x] * 10 # add a list
|
d[('L' + x).encode("ascii")] = [x] * 10 # add a list
|
||||||
|
|
|
@ -11,6 +11,7 @@ from bsddb import db
|
||||||
|
|
||||||
from .test_all import verbose
|
from .test_all import verbose
|
||||||
|
|
||||||
|
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ class GetReturnsNoneTestCase(unittest.TestCase):
|
||||||
d.open(self.filename, db.DB_BTREE, db.DB_CREATE)
|
d.open(self.filename, db.DB_BTREE, db.DB_CREATE)
|
||||||
d.set_get_returns_none(1)
|
d.set_get_returns_none(1)
|
||||||
|
|
||||||
for x in string.letters:
|
for x in letters:
|
||||||
x = x.encode("ascii")
|
x = x.encode("ascii")
|
||||||
d.put(x, x * 40)
|
d.put(x, x * 40)
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ class GetReturnsNoneTestCase(unittest.TestCase):
|
||||||
d.open(self.filename, db.DB_BTREE, db.DB_CREATE)
|
d.open(self.filename, db.DB_BTREE, db.DB_CREATE)
|
||||||
d.set_get_returns_none(0)
|
d.set_get_returns_none(0)
|
||||||
|
|
||||||
for x in string.letters:
|
for x in letters:
|
||||||
x = x.encode("ascii")
|
x = x.encode("ascii")
|
||||||
d.put(x, x * 40)
|
d.put(x, x * 40)
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ except ImportError:
|
||||||
|
|
||||||
from .test_all import verbose
|
from .test_all import verbose
|
||||||
|
|
||||||
|
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -45,7 +46,7 @@ class SimpleQueueTestCase(unittest.TestCase):
|
||||||
print("before appends" + '-' * 30)
|
print("before appends" + '-' * 30)
|
||||||
pprint(d.stat())
|
pprint(d.stat())
|
||||||
|
|
||||||
for x in string.letters:
|
for x in letters:
|
||||||
d.append(x * 40)
|
d.append(x * 40)
|
||||||
|
|
||||||
assert len(d) == 52
|
assert len(d) == 52
|
||||||
|
@ -117,7 +118,7 @@ class SimpleQueueTestCase(unittest.TestCase):
|
||||||
print("before appends" + '-' * 30)
|
print("before appends" + '-' * 30)
|
||||||
pprint(d.stat())
|
pprint(d.stat())
|
||||||
|
|
||||||
for x in string.letters:
|
for x in letters:
|
||||||
d.append(x * 40)
|
d.append(x * 40)
|
||||||
|
|
||||||
assert len(d) == 52
|
assert len(d) == 52
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue