[Zope3-dev] Re: SVN: Zope3/trunk/src/zope/app/pagelet/README.txt
fix test bug
from revision 28392; paths in tests need to be computed to
Godefroid Chapelle
gotcha at bubblenet.be
Thu Jan 20 10:10:08 EST 2005
Fred L. Drake, Jr. wrote:
> Log message for revision 28879:
> fix test bug from revision 28392; paths in tests need to be computed to
> avoid unnecessary dependence on the execution environment
>
>
> Changed:
> U Zope3/trunk/src/zope/app/pagelet/README.txt
>
> -=-
> Modified: Zope3/trunk/src/zope/app/pagelet/README.txt
> ===================================================================
> --- Zope3/trunk/src/zope/app/pagelet/README.txt 2005-01-19 22:17:16 UTC (rev 28878)
> +++ Zope3/trunk/src/zope/app/pagelet/README.txt 2005-01-19 22:17:39 UTC (rev 28879)
> @@ -216,8 +216,9 @@
> Setup a view page template called 'index':
>
> >>> from zope.app.pagelet.tests import testfiles
> - >>> index = ViewPageTemplateFile('index_pagelets.pt',
> - ... 'src/zope/app/pagelet/tests/testfiles')
> + >>> import os.path
> + >>> path = os.path.join(os.path.dirname(__file__), 'tests', 'testfiles')
> + >>> index = ViewPageTemplateFile('index_pagelets.pt', path)
>
> Call the 'index' (view) on the browser view instance:
Would it be worth adding a helper function/module in the doctest
environment like the following ?
>>> from zope.testing import doctest
>>> path = doctest.utils.absolute_path('tests', 'testfiles')
Cheers,
--
Godefroid Chapelle (aka __gotcha) http://bubblenet.be
More information about the Zope3-dev
mailing list