Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Acquisition
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
Acquisition
Commits
ea874f65
Commit
ea874f65
authored
Aug 09, 2009
by
Martijn Pieters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add slicing tests that demonstrate the 64-bit problem
parent
75a5f713
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
src/Acquisition/tests.py
src/Acquisition/tests.py
+31
-0
No files found.
src/Acquisition/tests.py
View file @
ea874f65
...
...
@@ -1686,6 +1686,7 @@ def test_Wrapper_gc():
def
test_proxying
():
"""Make sure that recent python slots are proxied.
>>> import sys
>>> import Acquisition
>>> class Impl(Acquisition.Implicit):
... pass
...
...
@@ -1702,6 +1703,9 @@ def test_proxying():
... def __iter__(self):
... print 'iterating...'
... return iter((42,))
... def __getslice__(self, start, end):
... print 'slicing...'
... return (start, end)
The naked class behaves like this:
...
...
@@ -1715,6 +1719,12 @@ def test_proxying():
>>> list(c)
iterating...
[42]
>>> c[5:10]
slicing...
(5, 10)
>>> c[5:] == (5, sys.maxint)
slicing...
True
Let's put c in the context of i:
...
...
@@ -1732,6 +1742,12 @@ def test_proxying():
>>> list(i.c)
iterating...
[42]
>>> i.c[5:10]
slicing...
(5, 10)
>>> i.c[5:] == (5, sys.maxint)
slicing...
True
Let's let's test the same again with an explicit wrapper:
...
...
@@ -1751,6 +1767,9 @@ def test_proxying():
... def __iter__(self):
... print 'iterating...'
... return iter((42,))
... def __getslice__(self, start, end):
... print 'slicing...'
... return (start, end)
The naked class behaves like this:
...
...
@@ -1764,6 +1783,12 @@ def test_proxying():
>>> list(c)
iterating...
[42]
>>> c[5:10]
slicing...
(5, 10)
>>> c[5:] == (5, sys.maxint)
slicing...
True
Let's put c in the context of i:
...
...
@@ -1781,6 +1806,12 @@ def test_proxying():
>>> list(i.c)
iterating...
[42]
>>> i.c[5:10]
slicing...
(5, 10)
>>> i.c[5:] == (5, sys.maxint)
slicing...
True
Finally let's check that https://bugs.launchpad.net/zope2/+bug/360761
has been fixed:
...
...
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