Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodb
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joshua
zodb
Commits
5e9c7810
Commit
5e9c7810
authored
Feb 15, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Py3k namnyisms: 'assertEquals' -> 'assertEqual'.
parent
690c699c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
27 deletions
+27
-27
src/ZODB/scripts/tests/test_repozo.py
src/ZODB/scripts/tests/test_repozo.py
+1
-1
src/ZODB/tests/IteratorStorage.py
src/ZODB/tests/IteratorStorage.py
+5
-5
src/ZODB/tests/PersistentStorage.py
src/ZODB/tests/PersistentStorage.py
+2
-2
src/ZODB/tests/RecoveryStorage.py
src/ZODB/tests/RecoveryStorage.py
+4
-4
src/ZODB/tests/testCache.py
src/ZODB/tests/testCache.py
+4
-4
src/ZODB/tests/testConnection.py
src/ZODB/tests/testConnection.py
+3
-3
src/ZODB/tests/testUtils.py
src/ZODB/tests/testUtils.py
+8
-8
No files found.
src/ZODB/scripts/tests/test_repozo.py
View file @
5e9c7810
...
@@ -898,7 +898,7 @@ class MonteCarloTests(unittest.TestCase):
...
@@ -898,7 +898,7 @@ class MonteCarloTests(unittest.TestCase):
g
.
close
()
g
.
close
()
msg
=
(
"guts don't match
\
n
correctpath=%r when=%r
\
n
cmd=%r"
%
msg
=
(
"guts don't match
\
n
correctpath=%r when=%r
\
n
cmd=%r"
%
(
correctpath
,
when
,
' '
.
join
(
argv
)))
(
correctpath
,
when
,
' '
.
join
(
argv
)))
self
.
assertEqual
s
(
fguts
,
gguts
,
msg
)
self
.
assertEqual
(
fguts
,
gguts
,
msg
)
def
test_suite
():
def
test_suite
():
...
...
src/ZODB/tests/IteratorStorage.py
View file @
5e9c7810
...
@@ -138,22 +138,22 @@ class IteratorStorage(IteratorCompare):
...
@@ -138,22 +138,22 @@ class IteratorStorage(IteratorCompare):
def
checkIterateRepeatedly
(
self
):
def
checkIterateRepeatedly
(
self
):
self
.
_dostore
()
self
.
_dostore
()
transactions
=
self
.
_storage
.
iterator
()
transactions
=
self
.
_storage
.
iterator
()
self
.
assertEqual
s
(
1
,
len
(
list
(
transactions
)))
self
.
assertEqual
(
1
,
len
(
list
(
transactions
)))
# The iterator can only be consumed once:
# The iterator can only be consumed once:
self
.
assertEqual
s
(
0
,
len
(
list
(
transactions
)))
self
.
assertEqual
(
0
,
len
(
list
(
transactions
)))
def
checkIterateRecordsRepeatedly
(
self
):
def
checkIterateRecordsRepeatedly
(
self
):
self
.
_dostore
()
self
.
_dostore
()
tinfo
=
next
(
self
.
_storage
.
iterator
())
tinfo
=
next
(
self
.
_storage
.
iterator
())
self
.
assertEqual
s
(
1
,
len
(
list
(
tinfo
)))
self
.
assertEqual
(
1
,
len
(
list
(
tinfo
)))
self
.
assertEqual
s
(
1
,
len
(
list
(
tinfo
)))
self
.
assertEqual
(
1
,
len
(
list
(
tinfo
)))
def
checkIterateWhileWriting
(
self
):
def
checkIterateWhileWriting
(
self
):
self
.
_dostore
()
self
.
_dostore
()
iterator
=
self
.
_storage
.
iterator
()
iterator
=
self
.
_storage
.
iterator
()
# We have one transaction with 1 modified object.
# We have one transaction with 1 modified object.
txn_1
=
next
(
iterator
)
txn_1
=
next
(
iterator
)
self
.
assertEqual
s
(
1
,
len
(
list
(
txn_1
)))
self
.
assertEqual
(
1
,
len
(
list
(
txn_1
)))
# We store another transaction with 1 object, the already running
# We store another transaction with 1 object, the already running
# iterator does not pick this up.
# iterator does not pick this up.
...
...
src/ZODB/tests/PersistentStorage.py
View file @
5e9c7810
...
@@ -45,5 +45,5 @@ class PersistentStorage:
...
@@ -45,5 +45,5 @@ class PersistentStorage:
# keep copies of all the objects
# keep copies of all the objects
for
oid
,
ver
,
p
,
s
in
objects
:
for
oid
,
ver
,
p
,
s
in
objects
:
_p
,
_s
=
self
.
_storage
.
load
(
oid
,
ver
)
_p
,
_s
=
self
.
_storage
.
load
(
oid
,
ver
)
self
.
assertEqual
s
(
p
,
_p
)
self
.
assertEqual
(
p
,
_p
)
self
.
assertEqual
s
(
s
,
_s
)
self
.
assertEqual
(
s
,
_s
)
src/ZODB/tests/RecoveryStorage.py
View file @
5e9c7810
...
@@ -131,8 +131,8 @@ class RecoveryStorage(IteratorDeepCompare):
...
@@ -131,8 +131,8 @@ class RecoveryStorage(IteratorDeepCompare):
transaction
.
commit
()
transaction
.
commit
()
r
=
db
.
open
().
root
()
r
=
db
.
open
().
root
()
self
.
assertEqual
s
(
r
[
"obj1"
].
x
,
'x1'
)
self
.
assertEqual
(
r
[
"obj1"
].
x
,
'x1'
)
self
.
assertEqual
s
(
r
[
"obj2"
].
x
,
'x2'
)
self
.
assertEqual
(
r
[
"obj2"
].
x
,
'x2'
)
# Dirty tricks.
# Dirty tricks.
if
is_filestorage
:
if
is_filestorage
:
...
@@ -176,8 +176,8 @@ class RecoveryStorage(IteratorDeepCompare):
...
@@ -176,8 +176,8 @@ class RecoveryStorage(IteratorDeepCompare):
self
.
_storage
.
tpc_finish
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
r
=
db
.
open
().
root
()
r
=
db
.
open
().
root
()
self
.
assertEqual
s
(
r
[
"obj1"
].
x
,
'x1'
)
self
.
assertEqual
(
r
[
"obj1"
].
x
,
'x1'
)
self
.
assertEqual
s
(
r
[
"obj2"
].
x
,
'x2'
)
self
.
assertEqual
(
r
[
"obj2"
].
x
,
'x2'
)
if
is_filestorage
:
if
is_filestorage
:
# Again _data_find should find both objects in this txn, and
# Again _data_find should find both objects in this txn, and
...
...
src/ZODB/tests/testCache.py
View file @
5e9c7810
...
@@ -240,18 +240,18 @@ class LRUCacheTests(CacheTestBase):
...
@@ -240,18 +240,18 @@ class LRUCacheTests(CacheTestBase):
for
i
in
range
(
CONNS
):
for
i
in
range
(
CONNS
):
self
.
noodle_new_connection
()
self
.
noodle_new_connection
()
self
.
assertEqual
s
(
self
.
db
.
cacheSize
(),
CACHE_SIZE
*
CONNS
)
self
.
assertEqual
(
self
.
db
.
cacheSize
(),
CACHE_SIZE
*
CONNS
)
details
=
self
.
db
.
cacheDetailSize
()
details
=
self
.
db
.
cacheDetailSize
()
self
.
assertEqual
s
(
len
(
details
),
CONNS
)
self
.
assertEqual
(
len
(
details
),
CONNS
)
for
d
in
details
:
for
d
in
details
:
self
.
assertEqual
s
(
d
[
'ngsize'
],
CACHE_SIZE
)
self
.
assertEqual
(
d
[
'ngsize'
],
CACHE_SIZE
)
# The assertion below is non-sensical
# The assertion below is non-sensical
# The (poorly named) cache size is a target for non-ghosts.
# The (poorly named) cache size is a target for non-ghosts.
# The cache *usually* contains non-ghosts, so that the
# The cache *usually* contains non-ghosts, so that the
# size normally exceeds the target size.
# size normally exceeds the target size.
#self.assertEqual
s
(d['size'], CACHE_SIZE)
#self.assertEqual(d['size'], CACHE_SIZE)
def
testDetail
(
self
):
def
testDetail
(
self
):
CACHE_SIZE
=
10
CACHE_SIZE
=
10
...
...
src/ZODB/tests/testConnection.py
View file @
5e9c7810
...
@@ -112,7 +112,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
...
@@ -112,7 +112,7 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
self
.
assertTrue
(
obj
.
_p_oid
is
None
)
self
.
assertTrue
(
obj
.
_p_oid
is
None
)
self
.
assertTrue
(
obj
.
_p_jar
is
None
)
self
.
assertTrue
(
obj
.
_p_jar
is
None
)
self
.
assertRaises
(
KeyError
,
self
.
datamgr
.
get
,
oid
)
self
.
assertRaises
(
KeyError
,
self
.
datamgr
.
get
,
oid
)
self
.
assertEqual
s
(
self
.
db
.
storage
.
_stored
,
[
oid
])
self
.
assertEqual
(
self
.
db
.
storage
.
_stored
,
[
oid
])
def
checkCommit
(
self
):
def
checkCommit
(
self
):
obj
=
StubObject
()
obj
=
StubObject
()
...
@@ -127,8 +127,8 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
...
@@ -127,8 +127,8 @@ class ConnectionDotAdd(ZODB.tests.util.TestCase):
# This next assertTrue is covered by an assert in tpc_finish.
# This next assertTrue is covered by an assert in tpc_finish.
##self.assertTrue(not self.datamgr._added)
##self.assertTrue(not self.datamgr._added)
self
.
assertEqual
s
(
self
.
db
.
storage
.
_stored
,
[
oid
])
self
.
assertEqual
(
self
.
db
.
storage
.
_stored
,
[
oid
])
self
.
assertEqual
s
(
self
.
db
.
storage
.
_finished
,
[
oid
])
self
.
assertEqual
(
self
.
db
.
storage
.
_finished
,
[
oid
])
def
checkModifyOnGetstate
(
self
):
def
checkModifyOnGetstate
(
self
):
member
=
StubObject
()
member
=
StubObject
()
...
...
src/ZODB/tests/testUtils.py
View file @
5e9c7810
...
@@ -48,17 +48,17 @@ class TestUtils(unittest.TestCase):
...
@@ -48,17 +48,17 @@ class TestUtils(unittest.TestCase):
for
num
in
self
.
all
:
for
num
in
self
.
all
:
s
=
p64
(
num
)
s
=
p64
(
num
)
n
=
U64
(
s
)
n
=
U64
(
s
)
self
.
assertEqual
s
(
num
,
n
,
"U64() failed"
)
self
.
assertEqual
(
num
,
n
,
"U64() failed"
)
n2
=
u64
(
s
)
n2
=
u64
(
s
)
self
.
assertEqual
s
(
num
,
n2
,
"u64() failed"
)
self
.
assertEqual
(
num
,
n2
,
"u64() failed"
)
def
checkKnownConstants
(
self
):
def
checkKnownConstants
(
self
):
self
.
assertEqual
s
(
b"
\
000
\
000
\
000
\
000
\
000
\
000
\
000
\
001
"
,
p64
(
1
))
self
.
assertEqual
(
b"
\
000
\
000
\
000
\
000
\
000
\
000
\
000
\
001
"
,
p64
(
1
))
self
.
assertEqual
s
(
b"
\
000
\
000
\
000
\
001
\
000
\
000
\
000
\
000
"
,
p64
(
1
<<
32
))
self
.
assertEqual
(
b"
\
000
\
000
\
000
\
001
\
000
\
000
\
000
\
000
"
,
p64
(
1
<<
32
))
self
.
assertEqual
s
(
u64
(
b"
\
000
\
000
\
000
\
000
\
000
\
000
\
000
\
001
"
),
1
)
self
.
assertEqual
(
u64
(
b"
\
000
\
000
\
000
\
000
\
000
\
000
\
000
\
001
"
),
1
)
self
.
assertEqual
s
(
U64
(
b"
\
000
\
000
\
000
\
000
\
000
\
000
\
000
\
001
"
),
1
)
self
.
assertEqual
(
U64
(
b"
\
000
\
000
\
000
\
000
\
000
\
000
\
000
\
001
"
),
1
)
self
.
assertEqual
s
(
u64
(
b"
\
000
\
000
\
000
\
001
\
000
\
000
\
000
\
000
"
),
1
<<
32
)
self
.
assertEqual
(
u64
(
b"
\
000
\
000
\
000
\
001
\
000
\
000
\
000
\
000
"
),
1
<<
32
)
self
.
assertEqual
s
(
U64
(
b"
\
000
\
000
\
000
\
001
\
000
\
000
\
000
\
000
"
),
1
<<
32
)
self
.
assertEqual
(
U64
(
b"
\
000
\
000
\
000
\
001
\
000
\
000
\
000
\
000
"
),
1
<<
32
)
def
checkPersistentIdHandlesDescriptor
(
self
):
def
checkPersistentIdHandlesDescriptor
(
self
):
from
ZODB.serialize
import
ObjectWriter
from
ZODB.serialize
import
ObjectWriter
...
...
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