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
02c910a7
Commit
02c910a7
authored
Nov 02, 2008
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repair breakage; restore commented-out ftest.
parent
3cbd69a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
lib/python/OFS/tests/testTraverse.py
lib/python/OFS/tests/testTraverse.py
+17
-20
No files found.
lib/python/OFS/tests/testTraverse.py
View file @
02c910a7
...
@@ -424,9 +424,9 @@ def test_traversable():
...
@@ -424,9 +424,9 @@ def test_traversable():
the wrong reason: None doesn't have a docstring so BaseRequest
the wrong reason: None doesn't have a docstring so BaseRequest
raises NotFoundError.)
raises NotFoundError.)
>>> from Products.Five.tests.testing
.simplecontent
\
>>> from Products.Five.tests.testing
import simplecontent
... import manage_addSimpleContent
>>> simplecontent.manage_addSimpleContent(self.folder, 'testoid',
>>> manage_addSimpleContent(self.folder, 'testoid',
'Testoid')
...
'Testoid')
>>> from zExceptions import NotFound
>>> from zExceptions import NotFound
>>> try:
>>> try:
... self.folder.testoid.unrestrictedTraverse('doesntexist')
... self.folder.testoid.unrestrictedTraverse('doesntexist')
...
@@ -471,9 +471,8 @@ def test_traversable():
...
@@ -471,9 +471,8 @@ def test_traversable():
... </configure>'''
... </configure>'''
>>> zcml.load_string(configure_zcml)
>>> zcml.load_string(configure_zcml)
>>> from Products.Five.tests.testing.fancycontent
\
>>> from Products.Five.tests.testing import fancycontent
... import manage_addFancyContent
>>> info = fancycontent.manage_addFancyContent(self.folder, 'fancy', '')
>>> info = manage_addFancyContent(self.folder, 'fancy', '')
In the following test we let the original __bobo_traverse__ method
In the following test we let the original __bobo_traverse__ method
kick in:
kick in:
...
@@ -510,10 +509,9 @@ def test_traversable():
...
@@ -510,10 +509,9 @@ def test_traversable():
the __bobo_traverse__ is the only element used for traversal lookup).
the __bobo_traverse__ is the only element used for traversal lookup).
Let's demonstrate:
Let's demonstrate:
>>> from Products.Five.tests.testing.fancycontent
\
>>> from Products.Five.tests.testing import fancycontent
... import manage_addNonTraversableFancyContent
>>> info = fancycontent.manage_addNonTraversableFancyContent(
>>> info = manage_addNonTraversableFancyContent(self.folder,
... self.folder, 'fancy_zope2', '')
... 'fancy_zope2', '')
>>> self.folder.fancy_zope2.an_attribute = 'This is an attribute'
>>> self.folder.fancy_zope2.an_attribute = 'This is an attribute'
>>> self.folder.fancy_zope2.unrestrictedTraverse(
>>> self.folder.fancy_zope2.unrestrictedTraverse(
... 'an_attribute').index_html({})
... 'an_attribute').index_html({})
...
@@ -536,8 +534,7 @@ def test_traversable():
...
@@ -536,8 +534,7 @@ def test_traversable():
Verify that after cleanup, there's no cruft left from five:traversable::
Verify that after cleanup, there's no cruft left from five:traversable::
>>> from Products.Five.browser.tests.test_traversable
\
>>> from Products.Five.browser.tests.test_traversable import SimpleClass
... import SimpleClass
>>> hasattr(SimpleClass, '__bobo_traverse__')
>>> hasattr(SimpleClass, '__bobo_traverse__')
False
False
>>> hasattr(SimpleClass, '__fallback_traverse__')
>>> hasattr(SimpleClass, '__fallback_traverse__')
...
@@ -588,15 +585,14 @@ def test_view_doesnt_shadow_attribute():
...
@@ -588,15 +585,14 @@ def test_view_doesnt_shadow_attribute():
Then we create a traversable folder...
Then we create a traversable folder...
>>> from Products.Five.tests.testing.folder
\
>>> from Products.Five.tests.testing import folder as ftf
... import manage_addFiveTraversableFolder
>>> ftf.manage_addFiveTraversableFolder(self.folder, 'ftf')
>>> manage_addFiveTraversableFolder(self.folder, 'ftf')
and add an object called ``eagle`` to it:
and add an object called ``eagle`` to it:
>>> from Products.Five.tests.testing
.simplecontent
\
>>> from Products.Five.tests.testing
import simplecontent
... import manage_addIndexSimpleContent
>>> simplecontent.manage_addIndexSimpleContent(self.folder.ftf,
>>> manage_addIndexSimpleContent(self.folder.ftf,
'eagle', 'Eagle')
...
'eagle', 'Eagle')
When we publish the ``ftf/eagle`` now, we expect the attribute to
When we publish the ``ftf/eagle`` now, we expect the attribute to
take precedence over the view during traversal:
take precedence over the view during traversal:
...
@@ -620,7 +616,8 @@ def test_view_doesnt_shadow_attribute():
...
@@ -620,7 +616,8 @@ def test_view_doesnt_shadow_attribute():
However, acquired attributes *should* be shadowed. See discussion on
However, acquired attributes *should* be shadowed. See discussion on
http://codespeak.net/pipermail/z3-five/2006q2/001474.html
http://codespeak.net/pipermail/z3-five/2006q2/001474.html
>>> manage_addIndexSimpleContent(self.folder, 'mouse', 'Mouse')
>>> simplecontent.manage_addIndexSimpleContent(self.folder,
... 'mouse', 'Mouse')
>>> self.folder.ftf.unrestrictedTraverse('mouse')()
>>> self.folder.ftf.unrestrictedTraverse('mouse')()
u'The mouse has been eaten by the eagle'
u'The mouse has been eaten by the eagle'
...
@@ -648,7 +645,7 @@ def test_suite():
...
@@ -648,7 +645,7 @@ def test_suite():
suite
=
unittest
.
TestSuite
()
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestTraverse
)
)
suite
.
addTest
(
unittest
.
makeSuite
(
TestTraverse
)
)
from
Testing.ZopeTestCase
import
FunctionalDocTestSuite
from
Testing.ZopeTestCase
import
FunctionalDocTestSuite
#
suite.addTest( FunctionalDocTestSuite() )
suite
.
addTest
(
FunctionalDocTestSuite
()
)
return
suite
return
suite
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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