Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zope.proxy
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
Boxiang Sun
zope.proxy
Commits
adf40692
Commit
adf40692
authored
Jun 06, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further test cleanup.
parent
f7392980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
19 deletions
+7
-19
src/zope/proxy/tests/test_proxy.py
src/zope/proxy/tests/test_proxy.py
+7
-19
No files found.
src/zope/proxy/tests/test_proxy.py
View file @
adf40692
...
@@ -32,10 +32,6 @@ class ProxyBaseTestCase(unittest.TestCase):
...
@@ -32,10 +32,6 @@ class ProxyBaseTestCase(unittest.TestCase):
from
zope.proxy
import
ProxyBase
from
zope.proxy
import
ProxyBase
return
ProxyBase
return
ProxyBase
def
setUp
(
self
):
self
.
x
=
Thing
()
self
.
p
=
self
.
new_proxy
(
self
.
x
)
def
new_proxy
(
self
,
o
):
def
new_proxy
(
self
,
o
):
return
self
.
proxy_class
(
o
)
return
self
.
proxy_class
(
o
)
...
@@ -81,6 +77,8 @@ class ProxyBaseTestCase(unittest.TestCase):
...
@@ -81,6 +77,8 @@ class ProxyBaseTestCase(unittest.TestCase):
self
.
assertEquals
(
list
(
p
),
list
(
'another'
))
self
.
assertEquals
(
list
(
p
),
list
(
'another'
))
def
test_proxy_attributes
(
self
):
def
test_proxy_attributes
(
self
):
class
Thing
:
"""This class is expected to be a classic class."""
o
=
Thing
()
o
=
Thing
()
o
.
foo
=
1
o
.
foo
=
1
w
=
self
.
new_proxy
(
o
)
w
=
self
.
new_proxy
(
o
)
...
@@ -96,6 +94,8 @@ class ProxyBaseTestCase(unittest.TestCase):
...
@@ -96,6 +94,8 @@ class ProxyBaseTestCase(unittest.TestCase):
from
zope.proxy._compat
import
PY3
from
zope.proxy._compat
import
PY3
# Proxies of old-style classes can't be pickled.
# Proxies of old-style classes can't be pickled.
if
not
PY3
:
# No old-style classes in Python 3.
if
not
PY3
:
# No old-style classes in Python 3.
class
Thing
:
"""This class is expected to be a classic class."""
w
=
self
.
new_proxy
(
Thing
())
w
=
self
.
new_proxy
(
Thing
())
self
.
assertRaises
(
pickle
.
PicklingError
,
self
.
assertRaises
(
pickle
.
PicklingError
,
pickle
.
dumps
,
w
)
pickle
.
dumps
,
w
)
...
@@ -758,34 +758,24 @@ class Test_nonOverridable(unittest.TestCase):
...
@@ -758,34 +758,24 @@ class Test_nonOverridable(unittest.TestCase):
self
.
assertEqual
(
proxy
.
what
(),
'PROXY'
)
self
.
assertEqual
(
proxy
.
what
(),
'PROXY'
)
class
Thing
:
"""This class is expected to be a classic class."""
class
Comparable
(
object
):
class
Comparable
(
object
):
def
__init__
(
self
,
value
):
def
__init__
(
self
,
value
):
self
.
value
=
value
self
.
value
=
value
def
__eq__
(
self
,
other
):
def
__eq__
(
self
,
other
):
if
hasattr
(
other
,
"value"
):
return
self
.
value
==
getattr
(
other
,
'value'
,
other
)
other
=
other
.
value
return
self
.
value
==
other
def
__ne__
(
self
,
other
):
def
__ne__
(
self
,
other
):
return
not
self
.
__eq__
(
other
)
return
not
self
.
__eq__
(
other
)
def
__lt__
(
self
,
other
):
def
__lt__
(
self
,
other
):
if
hasattr
(
other
,
"value"
):
return
self
.
value
<
getattr
(
other
,
'value'
,
other
)
other
=
other
.
value
return
self
.
value
<
other
def
__ge__
(
self
,
other
):
def
__ge__
(
self
,
other
):
return
not
self
.
__lt__
(
other
)
return
not
self
.
__lt__
(
other
)
def
__le__
(
self
,
other
):
def
__le__
(
self
,
other
):
if
hasattr
(
other
,
"value"
):
return
self
.
value
<=
getattr
(
other
,
'value'
,
other
)
other
=
other
.
value
return
self
.
value
<=
other
def
__gt__
(
self
,
other
):
def
__gt__
(
self
,
other
):
return
not
self
.
__le__
(
other
)
return
not
self
.
__le__
(
other
)
...
@@ -795,7 +785,6 @@ class Comparable(object):
...
@@ -795,7 +785,6 @@ class Comparable(object):
def
test_suite
():
def
test_suite
():
from
doctest
import
DocTestSuite
return
unittest
.
TestSuite
((
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
ModuleConformanceCase
),
unittest
.
makeSuite
(
ModuleConformanceCase
),
unittest
.
makeSuite
(
ProxyBaseTestCase
),
unittest
.
makeSuite
(
ProxyBaseTestCase
),
...
@@ -807,5 +796,4 @@ def test_suite():
...
@@ -807,5 +796,4 @@ def test_suite():
unittest
.
makeSuite
(
Test_queryInnerProxy
),
unittest
.
makeSuite
(
Test_queryInnerProxy
),
unittest
.
makeSuite
(
Test_sameProxiedObjects
),
unittest
.
makeSuite
(
Test_sameProxiedObjects
),
unittest
.
makeSuite
(
Test_nonOverridable
),
unittest
.
makeSuite
(
Test_nonOverridable
),
DocTestSuite
(),
))
))
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