[Checkins] SVN: z3c.resource/trunk/ - Using Python's ``doctest`` module instead of depreacted
Michael Howitz
mh at gocept.com
Mon Oct 4 02:28:44 EDT 2010
Log message for revision 117209:
- Using Python's ``doctest`` module instead of depreacted
``zope.testing.doctest``.
- Fixed tests to run with ZTK 1.0.
- Got rid of even undeclared `zope.app.zapi` depenency.
Changed:
U z3c.resource/trunk/CHANGES.txt
U z3c.resource/trunk/src/z3c/resource/browser/views.py
U z3c.resource/trunk/src/z3c/resource/testing.py
U z3c.resource/trunk/src/z3c/resource/tests.py
-=-
Modified: z3c.resource/trunk/CHANGES.txt
===================================================================
--- z3c.resource/trunk/CHANGES.txt 2010-10-04 06:23:03 UTC (rev 117208)
+++ z3c.resource/trunk/CHANGES.txt 2010-10-04 06:28:44 UTC (rev 117209)
@@ -2,12 +2,17 @@
CHANGES
=======
-Version 0.5.1dev (unreleased)
------------------------------
+0.5.1 (unreleased)
+------------------
-- ...
+- Using Python's ``doctest`` module instead of depreacted
+ ``zope.testing.doctest``.
-Version 0.5.0 (2008-04-16)
---------------------------
+- Fixed tests to run with ZTK 1.0.
-- Initial Release
+- Got rid of even undeclared `zope.app.zapi` depenency.
+
+0.5.0 (2008-04-16)
+------------------
+
+- Initial Release.
Modified: z3c.resource/trunk/src/z3c/resource/browser/views.py
===================================================================
--- z3c.resource/trunk/src/z3c/resource/browser/views.py 2010-10-04 06:23:03 UTC (rev 117208)
+++ z3c.resource/trunk/src/z3c/resource/browser/views.py 2010-10-04 06:28:44 UTC (rev 117209)
@@ -17,13 +17,12 @@
from zope.interface import implements
from zope.location import locate
+from zope.publisher.browser import BrowserView
from zope.publisher.interfaces import NotFound
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.traversing.interfaces import TraversalError
-from zope.publisher.browser import BrowserView
+import zope.component
-from zope.app import zapi
-
from z3c.resource import interfaces
@@ -36,15 +35,15 @@
"""See zope.publisher.interfaces.browser.IBrowserPublisher"""
if not interfaces.IResourceTraversable.providedBy(self.context):
- raise TraversalError(self.context,
+ raise TraversalError(self.context,
'Parameter context: IResourceTraversable required.')
# get the resource instance
resource = interfaces.IResource(self.context)
# first check if we get a name, if not, we return the resource
- # container itself. No fear local resource can't override global
- # resources because we lookup on different context for local resource
+ # container itself. No fear local resource can't override global
+ # resources because we lookup on different context for local resource
# then for a global resource.
if name == '':
return resource
@@ -58,17 +57,17 @@
# query the default site resource and raise not found if there is no
# resource item found. If you don't like to lookup at global resources
- # then you can override Resources view in your layer and skip this
+ # then you can override Resources view in your layer and skip this
# part.
return self._getSiteResource(name)
def _getSiteResource(self, name):
"""This will lookup resources on a ISite."""
- resource = zapi.queryAdapter(self.request, name=name)
+ resource = zope.component.queryAdapter(self.request, name=name)
if resource is None:
raise NotFound(self, name)
- sm = zapi.getSiteManager()
+ sm = zope.component.getSiteManager()
locate(resource, sm, name)
return resource
Modified: z3c.resource/trunk/src/z3c/resource/testing.py
===================================================================
--- z3c.resource/trunk/src/z3c/resource/testing.py 2010-10-04 06:23:03 UTC (rev 117208)
+++ z3c.resource/trunk/src/z3c/resource/testing.py 2010-10-04 06:28:44 UTC (rev 117209)
@@ -18,8 +18,8 @@
import zope.interface
-from zope.app.container.tests.test_icontainer import DefaultTestData
-from zope.app.container import contained
+from zope.container.tests.test_icontainer import DefaultTestData
+from zope.container import contained
from z3c.resource import interfaces
from z3c import testing
Modified: z3c.resource/trunk/src/z3c/resource/tests.py
===================================================================
--- z3c.resource/trunk/src/z3c/resource/tests.py 2010-10-04 06:23:03 UTC (rev 117208)
+++ z3c.resource/trunk/src/z3c/resource/tests.py 2010-10-04 06:28:44 UTC (rev 117209)
@@ -19,7 +19,6 @@
import doctest
import unittest
-from zope.testing.doctestunit import DocFileSuite
from zope.app.testing.placelesssetup import setUp
from zope.app.testing.placelesssetup import tearDown
@@ -38,7 +37,7 @@
unittest.makeSuite(TestResource),
doctest.DocTestSuite('z3c.resource.resource'),
doctest.DocTestSuite('z3c.resource.namespace'),
- DocFileSuite('README.txt', setUp=setUp, tearDown=tearDown,
+ doctest.DocFileSuite('README.txt', setUp=setUp, tearDown=tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
))
More information about the checkins
mailing list