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
d5f69194
Commit
d5f69194
authored
Jun 07, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Normalize out pickle sizes / offsets.
parent
1b048698
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
src/ZODB/FileStorage/iterator.test
src/ZODB/FileStorage/iterator.test
+6
-6
src/ZODB/FileStorage/tests.py
src/ZODB/FileStorage/tests.py
+8
-11
No files found.
src/ZODB/FileStorage/iterator.test
View file @
d5f69194
...
...
@@ -60,28 +60,28 @@ seems best and set the next record to that:
>>>
it
.
close
()
>>>
it
=
ZODB
.
FileStorage
.
FileIterator
(
'data.fs'
,
tids
[
1
])
Scan
forward
data
.
fs
:
4
looking
for
'\x03z\xbd\xd8\xd06\x9c\xcc'
Scan
forward
data
.
fs
:
<
OFFSET
>
looking
for
'\x03z\xbd\xd8\xd06\x9c\xcc'
>>>
it
.
next
()
.
tid
==
tids
[
1
]
True
>>>
it
.
close
()
>>>
it
=
ZODB
.
FileStorage
.
FileIterator
(
'data.fs'
,
tids
[
30
])
Scan
forward
data
.
fs
:
4
looking
for
'\x03z\xbd\xd8\xdc\x96.\xcc'
Scan
forward
data
.
fs
:
<
OFFSET
>
looking
for
'\x03z\xbd\xd8\xdc\x96.\xcc'
>>>
it
.
next
()
.
tid
==
tids
[
30
]
True
>>>
it
.
close
()
>>>
it
=
ZODB
.
FileStorage
.
FileIterator
(
'data.fs'
,
tids
[
70
])
Scan
backward
data
.
fs
:
117080
looking
for
'\x03z\xbd\xd8\xed\xa7>\xcc'
Scan
backward
data
.
fs
:
<
OFFSET
>
looking
for
'\x03z\xbd\xd8\xed\xa7>\xcc'
>>>
it
.
next
()
.
tid
==
tids
[
70
]
True
>>>
it
.
close
()
>>>
it
=
ZODB
.
FileStorage
.
FileIterator
(
'data.fs'
,
tids
[
-
2
])
Scan
backward
data
.
fs
:
117080
looking
for
'\x03z\xbd\xd8\xfa\x06\xd0\xcc'
Scan
backward
data
.
fs
:
<
OFFSET
>
looking
for
'\x03z\xbd\xd8\xfa\x06\xd0\xcc'
>>>
it
.
next
()
.
tid
==
tids
[
-
2
]
True
...
...
@@ -115,14 +115,14 @@ starting point, or just pick up where another iterator left off:
>>>
it
.
close
()
>>>
it
=
ZODB
.
FileStorage
.
FileIterator
(
'data.fs'
,
tids
[
50
],
pos
=
poss
[
50
])
Scan
backward
data
.
fs
:
35936
looking
for
'\x03z\xbd\xd8\xe5\x1e\xb6\xcc'
Scan
backward
data
.
fs
:
<
OFFSET
>
looking
for
'\x03z\xbd\xd8\xe5\x1e\xb6\xcc'
>>>
it
.
next
()
.
tid
==
tids
[
50
]
True
>>>
it
.
close
()
>>>
it
=
ZODB
.
FileStorage
.
FileIterator
(
'data.fs'
,
tids
[
49
],
pos
=
poss
[
50
])
Scan
backward
data
.
fs
:
35936
looking
for
'\x03z\xbd\xd8\xe4\xb1|\xcc'
Scan
backward
data
.
fs
:
<
OFFSET
>
looking
for
'\x03z\xbd\xd8\xe4\xb1|\xcc'
>>>
it
.
next
()
.
tid
==
tids
[
49
]
True
...
...
src/ZODB/FileStorage/tests.py
View file @
d5f69194
...
...
@@ -28,14 +28,8 @@ checker = renormalizing.RENormalizing([
# Python 3 adds module name to exceptions.
(
re
.
compile
(
"ZODB.POSException.POSKeyError"
),
r"POSKeyError"
),
(
re
.
compile
(
"ZODB.FileStorage.FileStorage.FileStorageQuotaError"
),
r"FileStorageQuotaError"
),
# Python 3 produces larger pickles, even when we use zodbpickle :(
# this changes all the offsets in iterator.test
(
re
.
compile
(
'data.fs:207766'
),
'data.fs:117080'
),
(
re
.
compile
(
'data.fs:57991'
),
'data.fs:35936'
),
# even with Pickler(bytes_as_strings=True) some of our pickles are larger
(
re
.
compile
(
'data.fs:117679'
),
'data.fs:117080'
),
(
re
.
compile
(
'data.fs:36241'
),
'data.fs:35936'
),
"FileStorageQuotaError"
),
(
re
.
compile
(
'data.fs:[0-9]+'
),
'data.fs:<OFFSET>'
),
])
def
pack_keep_old
():
...
...
@@ -195,11 +189,14 @@ cleanup
def
test_suite
():
return
unittest
.
TestSuite
((
doctest
.
DocFileSuite
(
'zconfig.txt'
,
'iterator.test'
,
setUp
=
ZODB
.
tests
.
util
.
setUp
,
tearDown
=
ZODB
.
tests
.
util
.
tearDown
,
'zconfig.txt'
,
'iterator.test'
,
setUp
=
ZODB
.
tests
.
util
.
setUp
,
tearDown
=
ZODB
.
tests
.
util
.
tearDown
,
checker
=
checker
),
doctest
.
DocTestSuite
(
setUp
=
ZODB
.
tests
.
util
.
setUp
,
tearDown
=
ZODB
.
tests
.
util
.
tearDown
,
setUp
=
ZODB
.
tests
.
util
.
setUp
,
tearDown
=
ZODB
.
tests
.
util
.
tearDown
,
checker
=
checker
),
))
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