Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ZopeUndo.Prefix decode on python 2
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
'random2', | ||
'mock', | ||
'msgpack-python', | ||
'ZopeUndo', | ||
] | ||
|
||
classifiers = """ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import unittest | ||
from ZEO.asyncio.marshal import encode | ||
from ZEO.asyncio.marshal import pickle_server_decode | ||
from ZopeUndo.Prefix import Prefix | ||
|
||
|
||
class MarshalTests(unittest.TestCase): | ||
|
||
def testServerDecodeZopeUndoFilter(self): | ||
# this is an example of Zope's | ||
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 | ||
|