[Checkins] SVN: Sandbox/darrylcousins/mars.contentprovider/ Updates
to get this old code working again
Darryl Cousins
darryl at darrylcousins.net.nz
Sat Feb 9 21:12:50 EST 2008
Log message for revision 83681:
Updates to get this old code working again
Changed:
U Sandbox/darrylcousins/mars.contentprovider/buildout.cfg
U Sandbox/darrylcousins/mars.contentprovider/setup.py
U Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/contentprovider.txt
U Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/contentprovider.py
U Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/ftesting.zcml
U Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/test_functional.py
U Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/tests.py
-=-
Modified: Sandbox/darrylcousins/mars.contentprovider/buildout.cfg
===================================================================
--- Sandbox/darrylcousins/mars.contentprovider/buildout.cfg 2008-02-10 01:56:45 UTC (rev 83680)
+++ Sandbox/darrylcousins/mars.contentprovider/buildout.cfg 2008-02-10 02:12:50 UTC (rev 83681)
@@ -1,11 +1,12 @@
[buildout]
develop = .
parts = test
-extends = http://grok.zope.org/releaseinfo/grok-0.11.1.cfg
+extends = http://download.zope.org/zope3.4/versions-3.4.0c1.cfg
versions = versions
[versions]
-martian = 0.9.2
+grok = 0.12dev
+martian = 0.9.3
[test]
recipe = zc.recipe.testrunner
Modified: Sandbox/darrylcousins/mars.contentprovider/setup.py
===================================================================
--- Sandbox/darrylcousins/mars.contentprovider/setup.py 2008-02-10 01:56:45 UTC (rev 83680)
+++ Sandbox/darrylcousins/mars.contentprovider/setup.py 2008-02-10 02:12:50 UTC (rev 83681)
@@ -14,14 +14,20 @@
This package uses ``martian`` and ``grok`` to register content providers
for applications built on the ``zope`` framework.""",
long_description=(
- read('src/mars/contentprovider/README.txt') +
+ read('mars/contentprovider/README.txt') +
read('CHANGES.txt')),
- packages=find_packages('src'),
- package_dir = {'': 'src'},
- include_package_data = True,
- zip_safe=False,
+ classifiers = ['Development Status :: 1 - Planning',
+ 'Intended Audience :: Developers',
+ 'License :: Other/Proprietary License',
+ 'Programming Language :: Python',
+ 'Operating System :: OS Independent',
+ 'Topic :: Software Development :: Build Tools',
+ 'Framework :: Zope3',
+ ],
+ packages=find_packages(),
+ namespace_packages=['mars'],
+ zip_safe=True,
license='ZPL',
- dependency_links = ['http://download.zope.org/distribution'],
extras_require = dict(
test=['zope.app.testing',
'mars.layer',
Modified: Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/contentprovider.txt
===================================================================
--- Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/contentprovider.txt 2008-02-10 01:56:45 UTC (rev 83680)
+++ Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/contentprovider.txt 2008-02-10 02:12:50 UTC (rev 83681)
@@ -47,9 +47,9 @@
module is ``grokked`` on start up.
>>> from mars.contentprovider.meta import ContentProviderGrokker
- >>> ContentProviderGrokker().grok('title', Title, zope.interface.Interface,
- ... module_info, None)
+ >>> ContentProviderGrokker().grok('', Title, module_info, config)
True
+ >>> config.execute_actions()
Testing the content provider
----------------------------
@@ -108,12 +108,13 @@
As before we need to manually ``grok`` the classes.
>>> from mars.view.meta import LayoutViewGrokker
- >>> LayoutViewGrokker().grok('', View, None, module_info, None)
+ >>> LayoutViewGrokker().grok('', View, module_info, config)
True
>>> from mars.template.meta import LayoutFactoryGrokker
- >>> LayoutFactoryGrokker().grok('', ViewTemplate, None, module_info, None)
+ >>> LayoutFactoryGrokker().grok('', ViewTemplate, module_info, config)
True
+ >>> config.execute_actions()
Now we can look up the view.
Modified: Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/contentprovider.py
===================================================================
--- Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/contentprovider.py 2008-02-10 01:56:45 UTC (rev 83680)
+++ Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/contentprovider.py 2008-02-10 02:12:50 UTC (rev 83681)
@@ -1,7 +1,4 @@
"""
- >>> import grok
- >>> grok.grok('mars.contentprovider.ftests.contentprovider')
- >>> from mars.contentprovider.ftests.contentprovider import Mammoth
>>> getRootFolder()["mammoth"] = Mammoth()
>>> from zope.testbrowser.testing import Browser
@@ -29,9 +26,9 @@
pass
# layer used for all registrations in this module
-mars.layer.layer(IMySkinLayer)
+grok.layer(IMySkinLayer)
-class MySkin(mars.layer.Skin):
+class MySkin(grok.Skin):
pass
class Mammoth(grok.Model):
Modified: Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/ftesting.zcml
===================================================================
--- Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/ftesting.zcml 2008-02-10 01:56:45 UTC (rev 83680)
+++ Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/ftesting.zcml 2008-02-10 02:12:50 UTC (rev 83681)
@@ -1,18 +1,39 @@
<configure xmlns="http://namespaces.zope.org/zope"
- xmlns:meta="http://namespaces.zope.org/meta"
- xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:grok="http://namespaces.zope.org/grok"
i18n_domain="zope"
package="mars.contentprovider.ftests">
- <include package="grok" file="meta.zcml" />
+ <include package="grok" />
+ <include package="zope.contentprovider" />
<include package="mars.template" file="meta.zcml" />
- <include package="mars.layer" file="meta.zcml" />
<include package="mars.view" file="meta.zcml" />
<include package="mars.contentprovider" file="meta.zcml" />
+ <grok:grok package="mars.contentprovider.ftests" />
- <include package="grok" />
- <include package="zope.contentprovider" />
+ <securityPolicy
+ component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy"
+ />
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User"
+ />
+ <grant
+ permission="zope.View"
+ principal="zope.anybody"
+ />
+
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw"
+ />
+
+ <role id="zope.Manager" title="Site Manager" />
+ <grantAll role="zope.Manager" />
+ <grant role="zope.Manager" principal="zope.mgr" />
+
</configure>
Modified: Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/test_functional.py
===================================================================
--- Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/test_functional.py 2008-02-10 01:56:45 UTC (rev 83680)
+++ Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/ftests/test_functional.py 2008-02-10 02:12:50 UTC (rev 83681)
@@ -1,10 +1,15 @@
+import os
import unittest
-from zope.testing import doctest
+from zope.testing import doctest
from zope.app.testing.functional import FunctionalTestSetup, getRootFolder
from zope.app.testing import functional
-functional.defineLayer('TestLayer', 'ftesting.zcml')
+ftesting_zcml = os.path.join(os.path.dirname(__file__), 'ftesting.zcml')
+TestLayer = functional.ZCMLLayer(
+ ftesting_zcml, __name__, 'TestLayer')
+
+
optionflags = doctest.NORMALIZE_WHITESPACE + doctest.ELLIPSIS
globs = dict(getRootFolder=getRootFolder)
@@ -18,14 +23,8 @@
suite = unittest.TestSuite()
dottedname = 'mars.contentprovider.ftests.contentprovider'
test = doctest.DocTestSuite(
- dottedname, setUp=setUp, globs=globs,
+ dottedname, setUp=setUp, extraglobs=globs,
tearDown=tearDown, optionflags=optionflags)
test.layer = TestLayer
suite.addTest(test)
return suite
-
-
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
-
Modified: Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/tests.py
===================================================================
--- Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/tests.py 2008-02-10 01:56:45 UTC (rev 83680)
+++ Sandbox/darrylcousins/mars.contentprovider/src/mars/contentprovider/tests.py 2008-02-10 02:12:50 UTC (rev 83681)
@@ -2,6 +2,7 @@
from zope.testing import doctest
import zope.interface
+from zope.configuration.config import ConfigurationMachine
from martian.interfaces import IModuleInfo
@@ -13,7 +14,8 @@
def getAnnotation(self, name, default):
return default
-globs = dict(module_info=ModuleInfo())
+globs = dict(module_info=ModuleInfo(),
+ config=ConfigurationMachine())
optionflags = doctest.NORMALIZE_WHITESPACE + doctest.ELLIPSIS
More information about the Checkins
mailing list