[Checkins] SVN: zope.file/trunk/src/zope/file/ go ahead and move
the functional tests to a separate layer
Fred L. Drake, Jr.
fdrake at gmail.com
Wed Sep 27 16:19:10 EDT 2006
Log message for revision 70403:
go ahead and move the functional tests to a separate layer
Changed:
D zope.file/trunk/src/zope/file/TODO.txt
A zope.file/trunk/src/zope/file/ftesting.zcml
U zope.file/trunk/src/zope/file/ftests.py
-=-
Deleted: zope.file/trunk/src/zope/file/TODO.txt
===================================================================
--- zope.file/trunk/src/zope/file/TODO.txt 2006-09-27 18:00:55 UTC (rev 70402)
+++ zope.file/trunk/src/zope/file/TODO.txt 2006-09-27 20:19:09 UTC (rev 70403)
@@ -1,4 +0,0 @@
-Things that need to be done:
-----------------------------
-
-- Create a separate functional testing layer
Added: zope.file/trunk/src/zope/file/ftesting.zcml
===================================================================
--- zope.file/trunk/src/zope/file/ftesting.zcml 2006-09-27 18:00:55 UTC (rev 70402)
+++ zope.file/trunk/src/zope/file/ftesting.zcml 2006-09-27 20:19:09 UTC (rev 70403)
@@ -0,0 +1,41 @@
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:browser="http://namespaces.zope.org/browser"
+ i18n_domain="zc.catalog"
+ >
+
+ <include package="zope.app" />
+ <include package="zope.app.authentication" />
+ <include package="zope.app.server" />
+
+ <include package="zope.mimetype" file="meta.zcml"/>
+ <include package="zope.mimetype"/>
+ <include package="zope.file"/>
+ <include package="zope.formlib"/>
+
+ <!-- Security -->
+
+ <include package="zope.app.securitypolicy" file="meta.zcml" />
+ <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" />
+
+ <grantAll role="zope.Manager" />
+
+
+ <unauthenticatedPrincipal id="zope.anybody" title="Unauthenticated User" />
+
+ <principal id="zope.mgr" title="Manager" login="mgr" password="mgrpw" />
+
+ <grant role="zope.Manager" principal="zope.mgr" />
+
+</configure>
Property changes on: zope.file/trunk/src/zope/file/ftesting.zcml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Modified: zope.file/trunk/src/zope/file/ftests.py
===================================================================
--- zope.file/trunk/src/zope/file/ftests.py 2006-09-27 18:00:55 UTC (rev 70402)
+++ zope.file/trunk/src/zope/file/ftests.py 2006-09-27 20:19:09 UTC (rev 70403)
@@ -15,17 +15,25 @@
"""
__docformat__ = "reStructuredText"
+import os.path
import unittest
import zope.app.testing.functional
+here = os.path.dirname(os.path.realpath(__file__))
+ZopeFileLayer = zope.app.testing.functional.ZCMLLayer(
+ os.path.join(here, "ftesting.zcml"), __name__, "ZopeFileLayer")
+
+
+def fromDocFile(path):
+ suite = zope.app.testing.functional.FunctionalDocFileSuite(path)
+ suite.layer = ZopeFileLayer
+ return suite
+
def test_suite():
- suite = unittest.TestSuite()
- suite.addTest(
- zope.app.testing.functional.FunctionalDocFileSuite("contenttype.txt"))
- suite.addTest(
- zope.app.testing.functional.FunctionalDocFileSuite("download.txt"))
- suite.addTest(
- zope.app.testing.functional.FunctionalDocFileSuite("upload.txt"))
- return suite
+ return unittest.TestSuite([
+ fromDocFile("contenttype.txt"),
+ fromDocFile("download.txt"),
+ fromDocFile("upload.txt"),
+ ])
More information about the Checkins
mailing list