Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
169f195b
Commit
169f195b
authored
Dec 01, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22943: bsddb tests are locale independend now.
This fixes tests on 8-bit locales (in particular on Windows).
parent
d5355178
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
25 deletions
+25
-25
Lib/bsddb/test/test_all.py
Lib/bsddb/test/test_all.py
+0
-3
Lib/bsddb/test/test_basics.py
Lib/bsddb/test/test_basics.py
+2
-2
Lib/bsddb/test/test_dbshelve.py
Lib/bsddb/test/test_dbshelve.py
+1
-1
Lib/bsddb/test/test_get_none.py
Lib/bsddb/test/test_get_none.py
+8
-8
Lib/bsddb/test/test_queue.py
Lib/bsddb/test/test_queue.py
+6
-7
Lib/bsddb/test/test_recno.py
Lib/bsddb/test/test_recno.py
+3
-4
Misc/NEWS
Misc/NEWS
+5
-0
No files found.
Lib/bsddb/test/test_all.py
View file @
169f195b
...
...
@@ -412,9 +412,6 @@ if sys.version_info[0] >= 3 :
def
get_dbp
(
self
)
:
return
self
.
_db
import
string
string
.
letters
=
[
chr
(
i
)
for
i
in
xrange
(
65
,
91
)]
bsddb
.
_db
.
DBEnv_orig
=
bsddb
.
_db
.
DBEnv
bsddb
.
_db
.
DB_orig
=
bsddb
.
_db
.
DB
if
bsddb
.
db
.
version
()
<=
(
4
,
3
)
:
...
...
Lib/bsddb/test/test_basics.py
View file @
169f195b
...
...
@@ -999,7 +999,7 @@ class BasicMultiDBTestCase(BasicTestCase):
for
x
in
"The quick brown fox jumped over the lazy dog"
.
split
():
d2
.
put
(
x
,
self
.
makeData
(
x
))
for
x
in
string
.
letters
:
for
x
in
string
.
ascii_
letters
:
d3
.
put
(
x
,
x
*
70
)
d1
.
sync
()
...
...
@@ -1047,7 +1047,7 @@ class BasicMultiDBTestCase(BasicTestCase):
if
verbose
:
print
rec
rec
=
c3
.
next
()
self
.
assertEqual
(
count
,
len
(
string
.
letters
))
self
.
assertEqual
(
count
,
len
(
string
.
ascii_
letters
))
c1
.
close
()
...
...
Lib/bsddb/test/test_dbshelve.py
View file @
169f195b
...
...
@@ -59,7 +59,7 @@ class DBShelveTestCase(unittest.TestCase):
return
bytes
(
key
,
"iso8859-1"
)
# 8 bits
def
populateDB
(
self
,
d
):
for
x
in
string
.
letters
:
for
x
in
string
.
ascii_
letters
:
d
[
self
.
mk
(
'S'
+
x
)]
=
10
*
x
# add a string
d
[
self
.
mk
(
'I'
+
x
)]
=
ord
(
x
)
# add an integer
d
[
self
.
mk
(
'L'
+
x
)]
=
[
x
]
*
10
# add a list
...
...
Lib/bsddb/test/test_get_none.py
View file @
169f195b
...
...
@@ -26,14 +26,14 @@ class GetReturnsNoneTestCase(unittest.TestCase):
d
.
open
(
self
.
filename
,
db
.
DB_BTREE
,
db
.
DB_CREATE
)
d
.
set_get_returns_none
(
1
)
for
x
in
string
.
letters
:
for
x
in
string
.
ascii_
letters
:
d
.
put
(
x
,
x
*
40
)
data
=
d
.
get
(
'bad key'
)
self
.
assertEqual
(
data
,
None
)
data
=
d
.
get
(
string
.
letters
[
0
])
self
.
assertEqual
(
data
,
string
.
letters
[
0
]
*
40
)
data
=
d
.
get
(
string
.
ascii_
letters
[
0
])
self
.
assertEqual
(
data
,
string
.
ascii_
letters
[
0
]
*
40
)
count
=
0
c
=
d
.
cursor
()
...
...
@@ -43,7 +43,7 @@ class GetReturnsNoneTestCase(unittest.TestCase):
rec
=
c
.
next
()
self
.
assertEqual
(
rec
,
None
)
self
.
assertEqual
(
count
,
len
(
string
.
letters
))
self
.
assertEqual
(
count
,
len
(
string
.
ascii_
letters
))
c
.
close
()
d
.
close
()
...
...
@@ -54,14 +54,14 @@ class GetReturnsNoneTestCase(unittest.TestCase):
d
.
open
(
self
.
filename
,
db
.
DB_BTREE
,
db
.
DB_CREATE
)
d
.
set_get_returns_none
(
0
)
for
x
in
string
.
letters
:
for
x
in
string
.
ascii_
letters
:
d
.
put
(
x
,
x
*
40
)
self
.
assertRaises
(
db
.
DBNotFoundError
,
d
.
get
,
'bad key'
)
self
.
assertRaises
(
KeyError
,
d
.
get
,
'bad key'
)
data
=
d
.
get
(
string
.
letters
[
0
])
self
.
assertEqual
(
data
,
string
.
letters
[
0
]
*
40
)
data
=
d
.
get
(
string
.
ascii_
letters
[
0
])
self
.
assertEqual
(
data
,
string
.
ascii_
letters
[
0
]
*
40
)
count
=
0
exceptionHappened
=
0
...
...
@@ -77,7 +77,7 @@ class GetReturnsNoneTestCase(unittest.TestCase):
self
.
assertNotEqual
(
rec
,
None
)
self
.
assertTrue
(
exceptionHappened
)
self
.
assertEqual
(
count
,
len
(
string
.
letters
))
self
.
assertEqual
(
count
,
len
(
string
.
ascii_
letters
))
c
.
close
()
d
.
close
()
...
...
Lib/bsddb/test/test_queue.py
View file @
169f195b
...
...
@@ -10,7 +10,6 @@ from test_all import db, verbose, get_new_database_path
#----------------------------------------------------------------------
@
unittest
.
skip
(
"fails on Windows; see issue 22943"
)
class
SimpleQueueTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
filename
=
get_new_database_path
()
...
...
@@ -37,17 +36,17 @@ class SimpleQueueTestCase(unittest.TestCase):
print
"before appends"
+
'-'
*
30
pprint
(
d
.
stat
())
for
x
in
string
.
letters
:
for
x
in
string
.
ascii_
letters
:
d
.
append
(
x
*
40
)
self
.
assertEqual
(
len
(
d
),
len
(
string
.
letters
))
self
.
assertEqual
(
len
(
d
),
len
(
string
.
ascii_
letters
))
d
.
put
(
100
,
"some more data"
)
d
.
put
(
101
,
"and some more "
)
d
.
put
(
75
,
"out of order"
)
d
.
put
(
1
,
"replacement data"
)
self
.
assertEqual
(
len
(
d
),
len
(
string
.
letters
)
+
3
)
self
.
assertEqual
(
len
(
d
),
len
(
string
.
ascii_
letters
)
+
3
)
if
verbose
:
print
"before close"
+
'-'
*
30
...
...
@@ -108,17 +107,17 @@ class SimpleQueueTestCase(unittest.TestCase):
print
"before appends"
+
'-'
*
30
pprint
(
d
.
stat
())
for
x
in
string
.
letters
:
for
x
in
string
.
ascii_
letters
:
d
.
append
(
x
*
40
)
self
.
assertEqual
(
len
(
d
),
len
(
string
.
letters
))
self
.
assertEqual
(
len
(
d
),
len
(
string
.
ascii_
letters
))
d
.
put
(
100
,
"some more data"
)
d
.
put
(
101
,
"and some more "
)
d
.
put
(
75
,
"out of order"
)
d
.
put
(
1
,
"replacement data"
)
self
.
assertEqual
(
len
(
d
),
len
(
string
.
letters
)
+
3
)
self
.
assertEqual
(
len
(
d
),
len
(
string
.
ascii_
letters
)
+
3
)
if
verbose
:
print
"before close"
+
'-'
*
30
...
...
Lib/bsddb/test/test_recno.py
View file @
169f195b
...
...
@@ -4,12 +4,11 @@
import
os
,
sys
import
errno
from
pprint
import
pprint
import
string
import
unittest
from
test_all
import
db
,
test_support
,
verbose
,
get_new_environment_path
,
get_new_database_path
letters
=
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
#----------------------------------------------------------------------
...
...
@@ -39,7 +38,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
d
.
open
(
self
.
filename
,
db
.
DB_RECNO
,
db
.
DB_CREATE
)
for
x
in
letters
:
for
x
in
string
.
ascii_
letters
:
recno
=
d
.
append
(
x
*
60
)
self
.
assertIsInstance
(
recno
,
int
)
self
.
assertGreaterEqual
(
recno
,
1
)
...
...
@@ -270,7 +269,7 @@ class SimpleRecnoTestCase(unittest.TestCase):
d
.
set_re_pad
(
45
)
# ...test both int and char
d
.
open
(
self
.
filename
,
db
.
DB_RECNO
,
db
.
DB_CREATE
)
for
x
in
letters
:
for
x
in
string
.
ascii_
letters
:
d
.
append
(
x
*
35
)
# These will be padded
d
.
append
(
'.'
*
40
)
# this one will be exact
...
...
Misc/NEWS
View file @
169f195b
...
...
@@ -30,6 +30,11 @@ Tools/Demos
- Issue #18905: "pydoc -p 0" now outputs actually used port. Based on patch by
Wieland Hoffmann.
Tests
-----
- Issue #22943: bsddb tests are locale independend now.
What'
s
New
in
Python
2.7.9
?
===========================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment