Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
57f77e4f
Commit
57f77e4f
authored
Nov 15, 2017
by
Philip Bauer
Committed by
GitHub
Nov 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #96 from mamico/zopeundo-py2
fix ZopeUndo.Prefix decode on python 2
parents
d8438a30
d0446bd3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
buildout.cfg
buildout.cfg
+2
-0
src/ZEO/asyncio/marshal.py
src/ZEO/asyncio/marshal.py
+1
-1
src/ZEO/tests/test_marshal.py
src/ZEO/tests/test_marshal.py
+34
-0
tox.ini
tox.ini
+2
-1
No files found.
buildout.cfg
View file @
57f77e4f
...
@@ -13,6 +13,8 @@ extra =
...
@@ -13,6 +13,8 @@ extra =
recipe = zc.recipe.testrunner
recipe = zc.recipe.testrunner
eggs =
eggs =
ZEO [test${buildout:extra}]
ZEO [test${buildout:extra}]
# ZopeUndo is needed as soft-dependency for a regression test
ZopeUndo
initialization =
initialization =
import os, tempfile
import os, tempfile
try: os.mkdir('tmp')
try: os.mkdir('tmp')
...
...
src/ZEO/asyncio/marshal.py
View file @
57f77e4f
...
@@ -157,7 +157,7 @@ def find_global(module, name):
...
@@ -157,7 +157,7 @@ def find_global(module, name):
def
server_find_global
(
module
,
name
):
def
server_find_global
(
module
,
name
):
"""Helper for message unpickler"""
"""Helper for message unpickler"""
try
:
try
:
if
module
!=
'ZopeUndo.Prefix'
:
if
module
not
in
(
'ZopeUndo.Prefix'
,
'copy_reg'
,
'__builtin__'
)
:
raise
ImportError
raise
ImportError
m
=
__import__
(
module
,
_globals
,
_globals
,
_silly
)
m
=
__import__
(
module
,
_globals
,
_globals
,
_silly
)
except
ImportError
as
msg
:
except
ImportError
as
msg
:
...
...
src/ZEO/tests/test_marshal.py
0 → 100644
View file @
57f77e4f
import
unittest
from
ZEO.asyncio.marshal
import
encode
from
ZEO.asyncio.marshal
import
pickle_server_decode
try
:
from
ZopeUndo.Prefix
import
Prefix
except
ImportError
:
_HAVE_ZOPE_UNDO
=
False
else
:
_HAVE_ZOPE_UNDO
=
True
class
MarshalTests
(
unittest
.
TestCase
):
@
unittest
.
skipUnless
(
_HAVE_ZOPE_UNDO
,
'ZopeUndo is not installed'
)
def
testServerDecodeZopeUndoFilter
(
self
):
# this is an example (1) of Zope2's arguments for
# undoInfo call. Arguments are encoded by ZEO client
# and decoded by server. The operation must be idempotent.
# (1) https://github.com/zopefoundation/Zope/blob/2.13/src/App/Undo.py#L111
args
=
(
0
,
20
,
{
'user_name'
:
Prefix
(
'test'
)})
# test against repr because Prefix __eq__ operator
# doesn't compare Prefix with Prefix but only
# Prefix with strings. see Prefix.__doc__
self
.
assertEqual
(
repr
(
pickle_server_decode
(
encode
(
*
args
))),
repr
(
args
)
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
MarshalTests
))
return
suite
tox.ini
View file @
57f77e4f
...
@@ -21,7 +21,8 @@ deps =
...
@@ -21,7 +21,8 @@ deps =
zope.testing
zope.testing
zope.testrunner
zope.testrunner
mock
mock
# ZopeUndo is needed as soft-dependency for a regression test
ZopeUndo
[testenv:simple]
[testenv:simple]
# Test that 'setup.py test' works
# Test that 'setup.py test' works
basepython
=
basepython
=
...
...
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