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
57e89244
Commit
57e89244
authored
Feb 20, 2013
by
Marius Gedminas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix fstest tests on Python 3
parent
37c20b52
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
src/ZODB/scripts/fstest.py
src/ZODB/scripts/fstest.py
+8
-11
src/ZODB/scripts/tests/test_fstest.py
src/ZODB/scripts/tests/test_fstest.py
+14
-3
No files found.
src/ZODB/scripts/fstest.py
View file @
57e89244
...
@@ -36,7 +36,7 @@ from __future__ import print_function
...
@@ -36,7 +36,7 @@ from __future__ import print_function
# ZODB.FileStorage. If anything about the FileStorage layout changes,
# ZODB.FileStorage. If anything about the FileStorage layout changes,
# this file will need to be udpated.
# this file will need to be udpated.
import
string
import
binascii
import
struct
import
struct
import
sys
import
sys
...
@@ -55,16 +55,13 @@ DREC_HDR_LEN = 42
...
@@ -55,16 +55,13 @@ DREC_HDR_LEN = 42
VERBOSE
=
0
VERBOSE
=
0
def
hexify
(
s
):
def
hexify
(
s
):
"""Format an 8-bit string as hex"""
r"""Format an 8-bit string as hex
l
=
[]
for
c
in
s
:
>>> hexify(b'\x00\xff\xaa\xcc')
h
=
hex
(
ord
(
c
))
'0x00ffaacc'
if
h
[:
2
]
==
'0x'
:
h
=
h
[
2
:]
"""
if
len
(
h
)
==
1
:
return
'0x'
+
binascii
.
hexlify
(
s
).
decode
()
l
.
append
(
"0"
)
l
.
append
(
h
)
return
"0x"
+
''
.
join
(
l
)
def
chatter
(
msg
,
level
=
1
):
def
chatter
(
msg
,
level
=
1
):
if
VERBOSE
>=
level
:
if
VERBOSE
>=
level
:
...
...
src/ZODB/scripts/tests/test_fstest.py
View file @
57e89244
...
@@ -11,9 +11,13 @@
...
@@ -11,9 +11,13 @@
# FOR A PARTICULAR PURPOSE.
# FOR A PARTICULAR PURPOSE.
#
#
##############################################################################
##############################################################################
from
zope.testing
import
setupstack
import
doctest
import
doctest
import
re
import
unittest
import
ZODB
import
ZODB
from
zope.testing
import
setupstack
from
zope.testing.renormalizing
import
RENormalizing
def
test_fstest_verbose
():
def
test_fstest_verbose
():
r"""
r"""
...
@@ -39,6 +43,13 @@ def test_fstest_verbose():
...
@@ -39,6 +43,13 @@ def test_fstest_verbose():
def
test_suite
():
def
test_suite
():
return
doctest
.
DocTestSuite
(
checker
=
RENormalizing
([
setUp
=
setupstack
.
setUpDirectory
,
tearDown
=
setupstack
.
tearDown
)
# Python 3 drops the u'' prefix on unicode strings
(
re
.
compile
(
r"u('[^']*')"
),
r"\1"
),
])
return
unittest
.
TestSuite
([
doctest
.
DocTestSuite
(
'ZODB.scripts.fstest'
,
checker
=
checker
),
doctest
.
DocTestSuite
(
setUp
=
setupstack
.
setUpDirectory
,
tearDown
=
setupstack
.
tearDown
),
])
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