Package: ulif.plone.testsetup
ulif.plone.testsetupis a package that provides some convenience stuff to enable rapid test
setup for Plone packages. Currently doctests (normal unit doctests and
functional doctests) and usual Python tests made ofunittest.TestCase(and derived) definitions are supported.Doctests and test modules are found throughout a whole package and
registered with sensible, modifiable defaults.Also support for reusable test setups is provided by so-called
TestGetters and TestCollectors.Setting up doctests (contrary towritingthose tests) can become
cumbersome with Plone. In the environment you often have to prepare
complex things like test layers, setup functions, teardown functions
and much more. Often this steps have to be done again and again.ulif.plone.testsetupcan shorten this work by setting sensible
defaults for the most important aspects of test setups.SeeREADME.txtin thesrc/ulif/plone/testsetupdirectory for API
documentation.ulif.plone.testsetupis an extension of the Zope 3
packagez3c.testsetupin which all the
basic stuff is defined and documented. Please see the .txt files in
this package for deeper insights about TestCollectors and the like.Note, that this is alphaware! Do not use it in productive
environments!PrerequisitesYou need:- Python 2.4. Rumors are, that also Python 2.5 will do.setuptools, available fromhttp://peak.telecommunity.com/DevCenter/setuptoolsOther needed packages will be downloaded during
installation. Therefore you need an internet connection during
installation.InstallationFrom the root of the package run:$ python2.4 bootstrap/bootstrap.pyThis will download and install everything to runbuildoutin the
next step. Afterwards an executable scriptbuildoutshould be
available in the freshly createdbin/directory.Next, fetch all needed packages, install them and create provided
scripts:$ bin/buildoutThis should create aninstancescript inbin/.Running:$ bin/instance test -s ulif.plone.testsetupyou can test the installed package.UsageSeeREADME.txtand the other .txt files in thesrc/ulif/plone/testsetupdirectory for API documentation.Detailed Documentationulif.plone.testsetupA package for easier test setups with Plone 3.ulif.plone.testsetuptries to ease the writing of testsetups. This
can be a mess, especially when using Plone. There is always a complex
framework to setup and all that might afraid people so that they do
not write tests at all. In that sense,ulif.plone.testsetupis a
try to take away excuses for not testing.Note, that this package is meant for use with Plone 3. Other versions
are not tested!Please note also, that this document isnotan introduction into
writing tests, but intosetupof tests. The difference is, that the
many kind of tests supported by Zope and Python need to be found by a
testrunner and some, functional tests for example, need a special
framework to be setup before the tests can actually run. That’s what
this package is for: minimizing the effort, to find and setup tests.A Simple Test SetupSetting up a test with this package in the minimal form comes down to
this:>>> from ulif.plone.testsetup import register_all_plone_tests
>>> test_suite = register_all_plone_tests(
...    'ulif.plone.testsetup.tests.cave')This will find all tests registered in thecavepackage and
deliver them to a testrunner when called. All we have to do, is to get
theregister_all_plone_testsfunction and to pass it a package.We specified the package to be searched for tests by a so-called
dotted name, but we can also pass the real package:>>> from ulif.plone.testsetup.tests import cave
>>> test_suite = register_all_plone_tests(cave)In both cases we will get aPloneTestCollector:>>> test_suite
<ulif.plone.testsetup.plonetesting.PloneTestCollector object at 0x...>When called, it will return a test suite:>>> test_suite()
<unittest.TestSuite tests=[...]>CHANGES0.1.2 (2008-07-11)Bug fixesPin down zope.testing version due to incompatibilities withplone.recipe.zop2install.0.1.1 (2008-07-11)Bug fixesFixed imports according to new z3c.testsetup release.0.1 (2008-03-05)Feature changesInitial release, factored out from z3c.testsetup-devDownload