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
d4696886
Commit
d4696886
authored
Jun 11, 2011
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand more tests, looks like specifying any value for the explicit argument causes the failure
parent
c9e5bead
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
src/Acquisition/tests.py
src/Acquisition/tests.py
+33
-0
No files found.
src/Acquisition/tests.py
View file @
d4696886
...
...
@@ -2463,6 +2463,37 @@ class TestParent(unittest.TestCase):
self
.
assertRaises
(
AttributeError
,
Acquisition
.
aq_acquire
,
c
,
'non_existant_attr'
)
class
TestAcquire
(
unittest
.
TestCase
):
def
test_explicit_default
(
self
):
class
Impl
(
Acquisition
.
Implicit
):
pass
class
Expl
(
Acquisition
.
Explicit
):
pass
a
=
Impl
(
'a'
)
a
.
y
=
42
a
.
b
=
Expl
(
'b'
)
a
.
b
.
z
=
3
a
.
b
.
c
=
Impl
(
'c'
)
value
=
a
.
b
.
c
.
aq_acquire
(
'z'
)
self
.
assertEqual
(
value
,
3
)
def
test_explicit_true
(
self
):
class
Impl
(
Acquisition
.
Implicit
):
pass
class
Expl
(
Acquisition
.
Explicit
):
pass
a
=
Impl
(
'a'
)
a
.
y
=
42
a
.
b
=
Expl
(
'b'
)
a
.
b
.
z
=
3
a
.
b
.
c
=
Impl
(
'c'
)
value
=
a
.
b
.
c
.
aq_acquire
(
'z'
,
explicit
=
True
)
self
.
assertEqual
(
value
,
3
)
def
test_explicit_false
(
self
):
class
Impl
(
Acquisition
.
Implicit
):
pass
...
...
@@ -2475,6 +2506,7 @@ class TestParent(unittest.TestCase):
a
.
b
.
z
=
3
a
.
b
.
c
=
Impl
(
'c'
)
value
=
a
.
b
.
c
.
aq_acquire
(
'z'
,
explicit
=
False
)
self
.
assertEqual
(
value
,
3
)
class
TestUnicode
(
unittest
.
TestCase
):
...
...
@@ -2533,5 +2565,6 @@ def test_suite():
DocTestSuite
(),
DocFileSuite
(
'README.txt'
,
package
=
'Acquisition'
),
unittest
.
makeSuite
(
TestParent
),
unittest
.
makeSuite
(
TestAcquire
),
unittest
.
makeSuite
(
TestUnicode
),
))
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