[Checkins] SVN: zc.recipe.zope3instance/branches/dev/ Start working
on doctest.
Jim Fulton
jim at zope.com
Mon Oct 16 06:53:00 EDT 2006
Log message for revision 70682:
Start working on doctest.
Changed:
A zc.recipe.zope3instance/branches/dev/buildout.cfg
A zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/README.txt
A zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/tests.py
-=-
Added: zc.recipe.zope3instance/branches/dev/buildout.cfg
===================================================================
--- zc.recipe.zope3instance/branches/dev/buildout.cfg 2006-10-16 10:51:53 UTC (rev 70681)
+++ zc.recipe.zope3instance/branches/dev/buildout.cfg 2006-10-16 10:53:00 UTC (rev 70682)
@@ -0,0 +1,7 @@
+[buildout]
+develop =
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = zc.recipe.zope3instance
Property changes on: zc.recipe.zope3instance/branches/dev/buildout.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Added: zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/README.txt
===================================================================
--- zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/README.txt 2006-10-16 10:51:53 UTC (rev 70681)
+++ zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/README.txt 2006-10-16 10:53:00 UTC (rev 70682)
@@ -0,0 +1,61 @@
+Zope 3 Instance Recipe
+======================
+
+The zc.recipe.zope3instance recipe creates a Zope 3 instance. A Zope
+3 instance is a collection of scripts and configure that define a Zope
+server process.
+
+Let's start with a minimal example. We have a sample buildout. Let's
+write a buildout.cfg file that defines a zope instance:
+
+ >>> cd(sample_buildout)
+ >>> write('buildout.cfg',
+ ... """
+ ... [buildout]
+ ... parts = instance
+ ...
+ ... [zope3]
+ ... location = %(zope3_installation)s
+ ...
+ ... [mydata]
+ ... zconfig =
+ ... <zodb>
+ ... <filestorage>
+ ... path /foo/baz/Data.fs
+ ... </filestorage>
+ ... </zodb>
+ ...
+ ... [instance]
+ ... database = mydata
+ ... user = jim:SHA1:40bd001563085fc35165329ea1ff5c5ecbdbbeef
+ ...
+ ... """
+ ... % dict(zope3_installation=sample_zope3))
+
+The Zope3 instance recipe needs to be told the location of a Zope 3
+installation. This can be done in two ways:
+
+1. Use a zope3checkout recipe to install Zope 3 from subversion, or
+
+2. Create a section with an option that provides the location of a
+ Zope 3 installation.
+
+
+We provided a zope3 section containing the location of an existing
+Zope3 installation.
+
+We also provided a section that provided a zconfig option containing a
+ZConfig definition for a database. We provided it by hand, but one
+would normally provide it using a part that used a database recipe,
+such as zc.recipe.filestorage or zc.recipe.clientstorage recipe.
+
+Let's run the buildout:
+
+ >>> print system(join('bin', 'buildout')),
+xs
+We'll get a directory created in the buildout parts directory
+containing configuration files and some directories to contain og
+files, pid files, and so on.
+
+ >>> ls(join('parts', 'instance'))
+
Property changes on: zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/README.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/tests.py
===================================================================
--- zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/tests.py 2006-10-16 10:51:53 UTC (rev 70681)
+++ zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/tests.py 2006-10-16 10:53:00 UTC (rev 70682)
@@ -0,0 +1,55 @@
+##############################################################################
+#
+# Copyright (c) 2006 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.
+#
+##############################################################################
+
+import os, re, shutil, sys, tempfile
+import pkg_resources
+
+
+
+import zc.buildout.testing
+
+import unittest
+import zope.testing
+from zope.testing import doctest, renormalizing
+
+def setUp(test):
+ zc.buildout.testing.buildoutSetUp(test)
+ zc.buildout.testing.install_develop('zc.recipe.zope3instance', test)
+ zc.buildout.testing.install('zope.testing', test)
+ zc.buildout.testing.install('zc.recipe.egg', test)
+ sample_zope3 = test.globs['tmpdir']()
+ test.globs['sample_zope3'] = sample_zope3
+ test.globs['mkdir'](sample_zope3, 'zopeskel')
+ test.globs['mkdir'](sample_zope3, 'zopeskel', 'etc')
+
+ test.globs['write'](sample_zope3, 'zopeskel', 'etc',
+ 'ftesting.zcml', 'This is ftesting')
+ test.globs['write'](sample_zope3, 'zopeskel', 'etc',
+ 'site.zcml', 'This is site')
+ test.globs['mkdir'](sample_zope3, 'zopeskel', 'package-includes')
+
+def test_suite():
+ return unittest.TestSuite((
+ #doctest.DocTestSuite(),
+ doctest.DocFileSuite(
+ 'README.txt',
+ setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
+ checker=renormalizing.RENormalizing([
+ ])
+ ),
+
+ ))
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
Property changes on: zc.recipe.zope3instance/branches/dev/src/zc/recipe/zope3instance/tests.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the Checkins
mailing list