[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ Added
AppComponentLayer, AppFileLayer, AppHttpLayer, PageTemplateLayer,
Baiju M
baiju.m.mail at gmail.com
Wed Feb 7 08:57:46 EST 2007
Log message for revision 72426:
Added AppComponentLayer, AppFileLayer, AppHttpLayer, PageTemplateLayer,
AppPublisherLayer, SecurityPolicyLayer and XmlrpcIntrospectionLayer.
Changed:
U Zope3/trunk/src/zope/app/component/browser/ftests.py
U Zope3/trunk/src/zope/app/component/browser/tests.py
A Zope3/trunk/src/zope/app/component/ftesting.zcml
U Zope3/trunk/src/zope/app/component/testing.py
U Zope3/trunk/src/zope/app/file/browser/ftests.py
A Zope3/trunk/src/zope/app/file/ftesting.zcml
A Zope3/trunk/src/zope/app/file/testing.py
A Zope3/trunk/src/zope/app/http/ftesting.zcml
U Zope3/trunk/src/zope/app/http/ftests/test_put.py
A Zope3/trunk/src/zope/app/http/testing.py
A Zope3/trunk/src/zope/app/pagetemplate/ftesting.zcml
U Zope3/trunk/src/zope/app/pagetemplate/ftests/test_nested.py
A Zope3/trunk/src/zope/app/pagetemplate/testing.py
A Zope3/trunk/src/zope/app/publisher/ftesting.zcml
A Zope3/trunk/src/zope/app/publisher/testing.py
U Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py
U Zope3/trunk/src/zope/app/securitypolicy/browser/ftests.py
A Zope3/trunk/src/zope/app/securitypolicy/ftesting.zcml
A Zope3/trunk/src/zope/app/securitypolicy/testing.py
A Zope3/trunk/src/zope/app/xmlrpcintrospection/ftesting.zcml
U Zope3/trunk/src/zope/app/xmlrpcintrospection/ftests.py
A Zope3/trunk/src/zope/app/xmlrpcintrospection/testing.py
-=-
Modified: Zope3/trunk/src/zope/app/component/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/component/browser/ftests.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/component/browser/ftests.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -21,12 +21,15 @@
from zope.testing import doctest
from zope.app.testing import functional
+from zope.app.component.testing import AppComponentLayer
def test_suite():
+ site = functional.FunctionalDocFileSuite(
+ "site.txt",
+ optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)
+ site.layer = AppComponentLayer
return unittest.TestSuite((
- functional.FunctionalDocFileSuite(
- "site.txt",
- optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
+ site,
))
Modified: Zope3/trunk/src/zope/app/component/browser/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/component/browser/tests.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/component/browser/tests.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -18,6 +18,7 @@
import unittest
import zope.app.testing.functional
+from zope.app.component.testing import AppComponentLayer
from zope import interface
@@ -32,8 +33,10 @@
def test_suite():
- return zope.app.testing.functional.FunctionalDocFileSuite(
+ suite = zope.app.testing.functional.FunctionalDocFileSuite(
'registration.txt')
+ suite.layer = AppComponentLayer
+ return suite
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
Added: Zope3/trunk/src/zope/app/component/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/component/ftesting.zcml 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/component/ftesting.zcml 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,41 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope"
+ package="zope.app.component"
+ >
+
+ <!-- This file is the equivalent of site.zcml and it is -->
+ <!-- used for functional testing setup -->
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+ <include package="zope.app.zcmlfiles" />
+ <include package="zope.app.authentication" />
+ <include package="zope.app.securitypolicy" />
+ <include package="zope.formlib" />
+
+ <securityPolicy
+ component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <role id="zope.Manager" title="Site Manager" />
+
+ <grantAll role="zope.Manager" />
+ <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+ <!-- Principal that tests generally run as -->
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw" />
+
+ <!-- Bootstrap principal used to make local grant to the principal above -->
+ <principal
+ id="zope.globalmgr"
+ title="Manager"
+ login="globalmgr"
+ password="globalmgrpw" />
+
+ <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>
Property changes on: Zope3/trunk/src/zope/app/component/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: Zope3/trunk/src/zope/app/component/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/component/testing.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/component/testing.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# Copyright (c) 2001-2007 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -13,8 +13,12 @@
##############################################################################
"""Base Mix-in class for Placeful Setups
+Also contains common test related classes/functions/objects.
+
$Id$
"""
+
+import os
import zope.interface
from zope.component.interfaces import IComponentLookup
from zope.app.component.interfaces import ILocalSiteManager
@@ -22,7 +26,12 @@
from zope.app.testing import setup
from zope.app.testing.placelesssetup import PlacelessSetup
from zope.app.folder import rootFolder
+from zope.app.testing.functional import ZCMLLayer
+AppComponentLayer = ZCMLLayer(
+ os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+ __name__, 'AppComponentLayer', allow_teardown=True)
+
class Place(object):
def __init__(self, path):
Modified: Zope3/trunk/src/zope/app/file/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/file/browser/ftests.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/file/browser/ftests.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -13,7 +13,7 @@
##############################################################################
"""Functional tests for File and Image.
-$Id: ftests.py 25177 2004-06-02 13:17:31Z jim $
+$Id$
"""
import unittest
from xml.sax.saxutils import escape
@@ -23,6 +23,7 @@
from zope.app.file.file import File
from zope.app.file.image import Image
from zope.app.file.tests.test_image import zptlogo
+from zope.app.file.testing import AppFileLayer
class FileTest(BrowserTestCase):
@@ -303,11 +304,17 @@
def test_suite():
from zope.app.testing import functional
+ FileTest.layer = AppFileLayer
+ ImageTest.layer = AppFileLayer
+ url = functional.FunctionalDocFileSuite('url.txt')
+ url.layer = AppFileLayer
+ file = functional.FunctionalDocFileSuite('file.txt')
+ file.layer = AppFileLayer
return unittest.TestSuite((
unittest.makeSuite(FileTest),
unittest.makeSuite(ImageTest),
- functional.FunctionalDocFileSuite('url.txt'),
- functional.FunctionalDocFileSuite('file.txt'),
+ url,
+ file,
))
if __name__ == '__main__':
Added: Zope3/trunk/src/zope/app/file/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/file/ftesting.zcml 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/file/ftesting.zcml 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,55 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope"
+ package="zope.app.file"
+ >
+
+ <!-- This file is the equivalent of site.zcml and it is -->
+ <!-- used for functional testing setup -->
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+ <include package="zope.app.zcmlfiles" />
+ <include package="zope.app.authentication" />
+ <include package="zope.app.securitypolicy" />
+ <include package="zope.app.file"/>
+
+ <securityPolicy
+ component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <role id="zope.Anonymous" title="Everybody"
+ description="All users have this role implicitly" />
+ <role id="zope.Manager" title="Site Manager" />
+
+ <!-- Replace the following directive if you don't want public access -->
+ <grant permission="zope.View"
+ role="zope.Anonymous" />
+ <grant permission="zope.app.dublincore.view"
+ role="zope.Anonymous" />
+
+ <grantAll role="zope.Manager" />
+ <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+ <!-- Principals -->
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User" />
+
+ <!-- Principal that tests generally run as -->
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw" />
+
+ <!-- Bootstrap principal used to make local grant to the principal above -->
+ <principal
+ id="zope.globalmgr"
+ title="Manager"
+ login="globalmgr"
+ password="globalmgrpw" />
+
+ <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>
Property changes on: Zope3/trunk/src/zope/app/file/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/file/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/file/testing.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/file/testing.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""zope.app.file common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+AppFileLayer = ZCMLLayer(
+ os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+ __name__, 'AppFileLayer', allow_teardown=True)
Property changes on: Zope3/trunk/src/zope/app/file/testing.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/http/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/http/ftesting.zcml 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/http/ftesting.zcml 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,41 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope"
+ package="zope.app.http"
+ >
+
+ <!-- This file is the equivalent of site.zcml and it is -->
+ <!-- used for functional testing setup -->
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+ <include package="zope.app.zcmlfiles" />
+ <include package="zope.app.authentication" />
+ <include package="zope.app.securitypolicy" />
+ <include package="zope.app.file"/>
+
+ <securityPolicy
+ component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <role id="zope.Manager" title="Site Manager" />
+
+ <grantAll role="zope.Manager" />
+ <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+ <!-- Principal that tests generally run as -->
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw" />
+
+ <!-- Bootstrap principal used to make local grant to the principal above -->
+ <principal
+ id="zope.globalmgr"
+ title="Manager"
+ login="globalmgr"
+ password="globalmgrpw" />
+
+ <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>
Property changes on: Zope3/trunk/src/zope/app/http/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: Zope3/trunk/src/zope/app/http/ftests/test_put.py
===================================================================
--- Zope3/trunk/src/zope/app/http/ftests/test_put.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/http/ftests/test_put.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -13,12 +13,13 @@
##############################################################################
"""Test HTTP PUT verb
-$Id: test_put.py 67630 2006-04-27 00:54:03Z jim $
+$Id$
"""
from unittest import TestSuite, makeSuite
from zope.app.testing.functional import FunctionalTestCase, HTTPCaller
+from zope.app.http.testing import AppHttpLayer
class TestPUT(FunctionalTestCase):
def test_put(self):
@@ -53,6 +54,7 @@
def test_suite():
+ TestPUT.layer = AppHttpLayer
return TestSuite((
makeSuite(TestPUT),
))
Added: Zope3/trunk/src/zope/app/http/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/http/testing.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/http/testing.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""zope.app.http common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+AppHttpLayer = ZCMLLayer(
+ os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+ __name__, 'AppHttpLayer', allow_teardown=True)
Property changes on: Zope3/trunk/src/zope/app/http/testing.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/pagetemplate/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/pagetemplate/ftesting.zcml 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/pagetemplate/ftesting.zcml 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,40 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope"
+ package="zope.app.pagetemplate"
+ >
+
+ <!-- This file is the equivalent of site.zcml and it is -->
+ <!-- used for functional testing setup -->
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+ <include package="zope.app.zcmlfiles" />
+ <include package="zope.app.zcmlfiles" file="ftesting.zcml" />
+ <include package="zope.app.authentication" />
+ <include package="zope.app.securitypolicy" />
+
+ <securityPolicy
+ component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <role id="zope.Manager" title="Site Manager" />
+
+ <grantAll role="zope.Manager" />
+
+ <!-- Principal that tests generally run as -->
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw" />
+
+ <!-- Bootstrap principal used to make local grant to the principal above -->
+ <principal
+ id="zope.globalmgr"
+ title="Manager"
+ login="globalmgr"
+ password="globalmgrpw" />
+
+ <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>
Property changes on: Zope3/trunk/src/zope/app/pagetemplate/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: Zope3/trunk/src/zope/app/pagetemplate/ftests/test_nested.py
===================================================================
--- Zope3/trunk/src/zope/app/pagetemplate/ftests/test_nested.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/pagetemplate/ftests/test_nested.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -3,8 +3,10 @@
__docformat__ = "reStructuredText"
import zope.app.testing.functional
+from zope.app.pagetemplate.testing import PageTemplateLayer
-
def test_suite():
- return zope.app.testing.functional.FunctionalDocFileSuite(
+ suite = zope.app.testing.functional.FunctionalDocFileSuite(
"test_nested.txt")
+ suite.layer = PageTemplateLayer
+ return suite
Added: Zope3/trunk/src/zope/app/pagetemplate/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/pagetemplate/testing.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/pagetemplate/testing.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""zope.app.pagetemplate common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+PageTemplateLayer = ZCMLLayer(
+ os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+ __name__, 'PageTemplateLayer', allow_teardown=True)
Property changes on: Zope3/trunk/src/zope/app/pagetemplate/testing.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/publisher/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/publisher/ftesting.zcml 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/publisher/ftesting.zcml 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,40 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope"
+ package="zope.app.publisher"
+ >
+
+ <!-- This file is the equivalent of site.zcml and it is -->
+ <!-- used for functional testing setup -->
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+ <include package="zope.app.zcmlfiles" />
+ <include package="zope.app.authentication" />
+ <include package="zope.app.securitypolicy" />
+
+ <securityPolicy
+ component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <role id="zope.Manager" title="Site Manager" />
+
+ <grantAll role="zope.Manager" />
+ <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+ <!-- Principal that tests generally run as -->
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw" />
+
+ <!-- Bootstrap principal used to make local grant to the principal above -->
+ <principal
+ id="zope.globalmgr"
+ title="Manager"
+ login="globalmgr"
+ password="globalmgrpw" />
+
+ <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>
Property changes on: Zope3/trunk/src/zope/app/publisher/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/publisher/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/testing.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/publisher/testing.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""zope.app.publisher common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+AppPublisherLayer = ZCMLLayer(
+ os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+ __name__, 'AppPublisherLayer', allow_teardown=True)
Property changes on: Zope3/trunk/src/zope/app/publisher/testing.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/publisher/xmlrpc/ftests.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -24,6 +24,7 @@
import zope.app.folder.folder
from zope.app.testing import functional, setup
+from zope.app.publisher.testing import AppPublisherLayer
def setUp(test):
setup.setUpTestAsModule(test, 'zope.app.publisher.xmlrpc.README')
@@ -48,10 +49,12 @@
(re.compile('<DateTime \''), '<DateTime u\''),
(re.compile('at [-0-9a-fA-F]+'), 'at <SOME ADDRESS>'),
))
- return functional.FunctionalDocFileSuite(
+ suite = functional.FunctionalDocFileSuite(
'README.txt', setUp=setUp, tearDown=tearDown,
checker=checker
)
+ suite.layer = AppPublisherLayer
+ return suite
if __name__ == '__main__':
import unittest
Modified: Zope3/trunk/src/zope/app/securitypolicy/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/browser/ftests.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/securitypolicy/browser/ftests.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -23,8 +23,8 @@
from zope.app.testing import functional
from zope.app.securitypolicy.role import Role
from zope.app.securitypolicy.interfaces import IRole
+from zope.app.securitypolicy.testing import SecurityPolicyLayer
-
class RolePermissionsTest(functional.BrowserTestCase):
def testAllRolePermissionsForm(self):
@@ -130,9 +130,12 @@
'''
def test_suite():
+ RolePermissionsTest.layer = SecurityPolicyLayer
+ granting = functional.FunctionalDocFileSuite('granting_ftest.txt')
+ granting.layer = SecurityPolicyLayer
return unittest.TestSuite((
unittest.makeSuite(RolePermissionsTest),
- functional.FunctionalDocFileSuite('granting_ftest.txt'),
+ granting,
))
if __name__ == '__main__':
Added: Zope3/trunk/src/zope/app/securitypolicy/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/ftesting.zcml 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/securitypolicy/ftesting.zcml 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,41 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope"
+ package="zope.app.securitypolicy"
+ >
+
+ <!-- This file is the equivalent of site.zcml and it is -->
+ <!-- used for functional testing setup -->
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+ <include package="zope.app.zcmlfiles" />
+ <include package="zope.app.authentication" />
+ <include package="zope.app.securitypolicy" />
+
+ <securityPolicy
+ component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <role id="zope.Manager" title="Site Manager" />
+ <role id="zope.Member" title="Site Member" />
+
+ <grantAll role="zope.Manager" />
+ <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+ <!-- Principal that tests generally run as -->
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw" />
+
+ <!-- Bootstrap principal used to make local grant to the principal above -->
+ <principal
+ id="zope.globalmgr"
+ title="Manager"
+ login="globalmgr"
+ password="globalmgrpw" />
+
+ <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>
Property changes on: Zope3/trunk/src/zope/app/securitypolicy/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/securitypolicy/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/testing.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/securitypolicy/testing.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""zope.app.securitypolicy common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+SecurityPolicyLayer = ZCMLLayer(
+ os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+ __name__, 'SecurityPolicyLayer', allow_teardown=True)
Property changes on: Zope3/trunk/src/zope/app/securitypolicy/testing.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/xmlrpcintrospection/ftesting.zcml
===================================================================
--- Zope3/trunk/src/zope/app/xmlrpcintrospection/ftesting.zcml 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/xmlrpcintrospection/ftesting.zcml 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,52 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ i18n_domain="zope"
+ package="zope.app.xmlrpcintrospection"
+ >
+
+ <!-- This file is the equivalent of site.zcml and it is -->
+ <!-- used for functional testing setup -->
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+
+ <include package="zope.app.zcmlfiles" />
+ <include package="zope.app.authentication" />
+ <include package="zope.app.securitypolicy" />
+
+ <securityPolicy
+ component="zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+ <role id="zope.Anonymous" title="Everybody"
+ description="All users have this role implicitly" />
+ <role id="zope.Manager" title="Site Manager" />
+
+ <!-- Replace the following directive if you don't want public access -->
+ <grant permission="zope.View"
+ role="zope.Anonymous" />
+
+ <grantAll role="zope.Manager" />
+ <include package="zope.app.securitypolicy.tests" file="functional.zcml" />
+
+ <!-- Principals -->
+
+ <unauthenticatedPrincipal
+ id="zope.anybody"
+ title="Unauthenticated User" />
+
+ <!-- Principal that tests generally run as -->
+ <principal
+ id="zope.mgr"
+ title="Manager"
+ login="mgr"
+ password="mgrpw" />
+
+ <!-- Bootstrap principal used to make local grant to the principal above -->
+ <principal
+ id="zope.globalmgr"
+ title="Manager"
+ login="globalmgr"
+ password="globalmgrpw" />
+
+ <grant role="zope.Manager" principal="zope.globalmgr" />
+
+</configure>
Property changes on: Zope3/trunk/src/zope/app/xmlrpcintrospection/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: Zope3/trunk/src/zope/app/xmlrpcintrospection/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/xmlrpcintrospection/ftests.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/xmlrpcintrospection/ftests.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -19,6 +19,7 @@
import zope.app.folder.folder
import zope.publisher.interfaces.xmlrpc
from zope.app.testing import ztapi, functional, setup
+from zope.app.xmlrpcintrospection.testing import XmlrpcIntrospectionLayer
def setUp(test):
setup.setUpTestAsModule(test, 'zope.app.xmlrpcintrospection.README')
@@ -47,8 +48,10 @@
setup.tearDownTestAsModule(test)
def test_suite():
- return functional.FunctionalDocFileSuite(
+ suite = functional.FunctionalDocFileSuite(
'README.txt', setUp=setUp, tearDown=tearDown)
+ suite.layer = XmlrpcIntrospectionLayer
+ return suite
if __name__ == '__main__':
import unittest
Added: Zope3/trunk/src/zope/app/xmlrpcintrospection/testing.py
===================================================================
--- Zope3/trunk/src/zope/app/xmlrpcintrospection/testing.py 2007-02-07 13:34:28 UTC (rev 72425)
+++ Zope3/trunk/src/zope/app/xmlrpcintrospection/testing.py 2007-02-07 13:57:45 UTC (rev 72426)
@@ -0,0 +1,26 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""zope.app.xmlrpcintrospection common test related classes/functions/objects.
+
+$Id$
+"""
+
+__docformat__ = "reStructuredText"
+
+import os
+from zope.app.testing.functional import ZCMLLayer
+
+XmlrpcIntrospectionLayer = ZCMLLayer(
+ os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+ __name__, 'XmlrpcIntrospectionLayer', allow_teardown=True)
Property changes on: Zope3/trunk/src/zope/app/xmlrpcintrospection/testing.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the Zope3-Checkins
mailing list