Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Zope
Commits
7e02bbc4
Commit
7e02bbc4
authored
Feb 19, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test output reproducible across runs.
parent
8270dce1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
16 deletions
+25
-16
lib/Components/ExtensionClass/test/test_AqAlg.py
lib/Components/ExtensionClass/test/test_AqAlg.py
+11
-6
lib/Components/ExtensionClass/test/test_acquisition.py
lib/Components/ExtensionClass/test/test_acquisition.py
+2
-1
lib/Components/ExtensionClass/test/test_binding.py
lib/Components/ExtensionClass/test/test_binding.py
+6
-4
lib/Components/ExtensionClass/test/test_explicit_acquisition.py
...mponents/ExtensionClass/test/test_explicit_acquisition.py
+2
-1
lib/Components/ExtensionClass/test/test_method_hook.py
lib/Components/ExtensionClass/test/test_method_hook.py
+4
-4
No files found.
lib/Components/ExtensionClass/test/AqAlg.py
→
lib/Components/ExtensionClass/test/
test_
AqAlg.py
View file @
7e02bbc4
...
...
@@ -85,12 +85,19 @@
__doc__
=
'''Examples from the Acquisition Algebra Presentation
$Id: AqAlg.py,v 1.2 2000/06/19 20:30:52 jim Exp $'''
__version__
=
'$Revision: 1.2 $'
[
11
:
-
2
]
$Id: test_AqAlg.py,v 1.1 2001/02/19 19:21:12 jeremy Exp $'''
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
import
Acquisition
import
sys
def
uid
(
obj
,
uids
=
{}):
uid
=
uids
.
get
(
id
(
obj
))
if
uid
is
None
:
uid
=
uids
[
id
(
obj
)]
=
len
(
uids
)
+
1
return
uid
def
pretty
(
self
,
indent
=
0
):
context
=
getattr
(
self
,
'aq_parent'
,
None
)
if
context
is
None
:
return
self
.
__name__
...
...
@@ -107,12 +114,10 @@ class I(Acquisition.Implicit):
def
__init__
(
self
,
name
):
self
.
__name__
=
name
def
__str__
(
self
):
context
=
getattr
(
self
,
'aq_parent'
,
None
)
if
context
is
None
:
return
self
.
__name__
return
"(%s: %s of %s)"
%
(
id
(
self
),
self
.
aq_self
,
context
)
return
"(%s: %s of %s)"
%
(
u
id
(
self
),
self
.
aq_self
,
context
)
__repr__
=
__str__
...
...
lib/Components/ExtensionClass/test/test_acquisition.py
View file @
7e02bbc4
...
...
@@ -5,7 +5,8 @@ class B(Base):
color
=
'red'
class
A
(
Acquisition
.
Implicit
):
def
hi
(
self
):
print
self
,
self
.
color
def
hi
(
self
):
print
"%s()"
%
self
.
__class__
.
__name__
,
self
.
color
b
=
B
()
b
.
a
=
A
()
...
...
lib/Components/ExtensionClass/test/test_binding.py
View file @
7e02bbc4
from
ExtensionClass
import
Base
from
MethodObject
import
Method
class
foo
(
Method
):
def
__call__
(
self
,
ob
,
*
args
,
**
kw
):
print
'called'
,
ob
,
args
,
kw
def
__call__
(
self
,
ob
,
*
args
,
**
kw
):
print
'called'
,
ob
,
args
,
kw
class
bar
(
Base
):
hi
=
foo
()
def
__repr__
(
self
):
return
"bar()"
hi
=
foo
()
x
=
bar
()
hi
=
x
.
hi
print
hi
print
type
(
hi
)
hi
(
1
,
2
,
3
,
name
=
'spam'
)
lib/Components/ExtensionClass/test/test_explicit_acquisition.py
View file @
7e02bbc4
...
...
@@ -5,7 +5,8 @@ class B(Base):
color
=
'red'
class
A
(
Acquisition
.
Explicit
):
def
hi
(
self
):
print
self
,
self
.
acquire
(
'color'
)
def
hi
(
self
):
print
self
.
__class__
.
__name__
,
self
.
acquire
(
'color'
)
b
=
B
()
b
.
a
=
A
()
...
...
lib/Components/ExtensionClass/test/test_method_hook.py
View file @
7e02bbc4
import
ExtensionClass
class
C
(
ExtensionClass
.
Base
):
def
__call_method__
(
self
,
meth
,
args
,
kw
=
{}):
def
__call_method__
(
self
,
meth
,
args
,
kw
=
{}):
print
'give us a hook, hook, hook...'
apply
(
meth
,
args
,
kw
)
return
apply
(
meth
,
args
,
kw
)
def
hi
(
self
,
*
args
,
**
kw
):
print
self
,
args
,
kw
def
hi
(
self
,
*
args
,
**
kw
):
print
"%s()"
%
self
.
__class__
.
__name__
,
args
,
kw
c
=
C
()
c
.
hi
()
...
...
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