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
Kirill Smelkov
ZODB
Commits
65558dbf
Commit
65558dbf
authored
Oct 08, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up trailing whitespace and long lines.
parent
9ea3cc2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
src/ZODB/tests/testFileStorage.py
src/ZODB/tests/testFileStorage.py
+16
-13
No files found.
src/ZODB/tests/testFileStorage.py
View file @
65558dbf
...
...
@@ -347,33 +347,35 @@ class AnalyzeDotPyTest(StorageTestBase.StorageTestBase):
import
new
,
sys
,
pickle
from
BTrees.OOBTree
import
OOBTree
from
ZODB.scripts
import
analyze
# Set up a module to act as a broken import
module_name
=
'brokenmodule'
module
=
new
.
module
(
module_name
)
sys
.
modules
[
module_name
]
=
module
class
Broken
(
MinPO
):
__module__
=
module_name
module
.
Broken
=
Broken
oids
=
[[
self
.
_storage
.
new_oid
(),
None
]
for
i
in
range
(
3
)]
for
i
in
range
(
2
):
t
=
transaction
.
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
# sometimes data is in this format
j
=
0
oid
,
revid
=
oids
[
j
]
serial
=
self
.
_storage
.
store
(
oid
,
revid
,
pickle
.
dumps
(
OOBTree
,
1
),
""
,
t
)
serial
=
self
.
_storage
.
store
(
oid
,
revid
,
pickle
.
dumps
(
OOBTree
,
1
),
""
,
t
)
oids
[
j
][
1
]
=
serial
# and it could be from a broken module
j
=
1
oid
,
revid
=
oids
[
j
]
serial
=
self
.
_storage
.
store
(
oid
,
revid
,
pickle
.
dumps
(
Broken
,
1
),
""
,
t
)
serial
=
self
.
_storage
.
store
(
oid
,
revid
,
pickle
.
dumps
(
Broken
,
1
),
""
,
t
)
oids
[
j
][
1
]
=
serial
# but mostly it looks like this
j
=
2
o
=
MinPO
(
j
)
...
...
@@ -383,16 +385,16 @@ class AnalyzeDotPyTest(StorageTestBase.StorageTestBase):
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
# now break the import of the Broken class
del
sys
.
modules
[
module_name
]
# from ZODB.scripts.analyze.analyze
fsi
=
self
.
_storage
.
iterator
()
rep
=
analyze
.
Report
()
for
txn
in
fsi
:
analyze
.
analyze_trans
(
rep
,
txn
)
# from ZODB.scripts.analyze.report
typemap
=
rep
.
TYPEMAP
.
keys
()
typemap
.
sort
()
...
...
@@ -400,8 +402,9 @@ class AnalyzeDotPyTest(StorageTestBase.StorageTestBase):
for
t
in
typemap
:
pct
=
rep
.
TYPESIZE
[
t
]
*
100.0
/
rep
.
DBYTES
cumpct
+=
pct
self
.
assertAlmostEqual
(
cumpct
,
100.0
,
0
,
"Failed to analyze some records"
)
self
.
assertAlmostEqual
(
cumpct
,
100.0
,
0
,
"Failed to analyze some records"
)
# Raise an exception if the tids in FileStorage fs aren't
# strictly increasing.
...
...
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