Commit 40270cb5 authored by Julien Muchembled's avatar Julien Muchembled

Update tests

parent 6219b5dc
......@@ -28,6 +28,9 @@ setup(name=name,
'zc.buildout', # plays with buildout
'jinja2>=2.7',
],
tests_require=[
'zope.testing',
],
zip_safe=True,
entry_points={
'zc.buildout': [
......
......@@ -48,8 +48,6 @@ We run buildout::
>>> print system(join('bin', 'buildout')),
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
And the template has been rendered::
......@@ -182,8 +180,6 @@ Use jinja2 extensions
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('foo')
foo, template
......@@ -211,8 +207,6 @@ Compute template's MD5 sum::
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('foo')
template
......@@ -232,12 +226,10 @@ If the md5sum doesn't match, the buildout fail::
... md5sum = 0123456789abcdef0123456789abcdef
... ''')
>>> print system(join('bin', 'buildout')),
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
Uninstalling template.
Installing template.
While:
Installing.
Getting section template.
Initializing section template.
Installing template.
Error: MD5 checksum mismatch for local resource at 'foo.in'.
......@@ -260,10 +252,7 @@ You can specify the mode for rendered file::
... mode = 205
... ''')
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
And the generated file with have the right permissions::
......@@ -302,8 +291,6 @@ imported::
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('bar')
FOO !
......@@ -325,8 +312,6 @@ Just like context definition, it also works with indirect values::
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('bar')
FOO !
......@@ -371,8 +356,6 @@ All templates can be accessed inside both folders::
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('bar')
a1foo
a2foo
......@@ -411,8 +394,6 @@ path)::
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('bar')
a1foo
a2foo
......@@ -446,8 +427,6 @@ will be installed as dependency::
foobar='dependency content'
recipe='zc.buildout:debug'
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
This way you can get options which are computed in the ``__init__`` of
the dependent recipe.
......@@ -496,13 +475,11 @@ Let's just use ``buildout.cfg`` using this egg::
... recipe = samplerecipe
... ''')
>>> print system(join('bin', 'buildout')),
Develop: ...
Develop: '/sample-buildout/.'
Uninstalling template.
Uninstalling dependency.
Installing sample.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('foo')
foobar
......@@ -527,18 +504,14 @@ rendering.
... rendered = foo_once
... once = foo_flag
... ''')
>>> print system(join('bin', 'buildout')),
>>> print system(join('bin', 'buildout')), # doctest: +ELLIPSIS
Uninstalling template.
Uninstalling sample.
Getting distribution for 'samplerecipe'.
Got samplerecipe 0.0.0.
Installing template.
The template install returned None. A path or iterable os paths should be returned.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../samplerecipe/
Not found: /tmp/.../samplerecipe/
warning: install_lib: 'build/lib' does not exist -- no Python modules to install
warning: install_lib: '...' does not exist -- no Python modules to install
<BLANKLINE>
zip_safe flag not set; analyzing archive contents...
......@@ -562,8 +535,6 @@ Remove rendered file and re-render::
Installing template.
The template install returned None. A path or iterable os paths should be returned.
Unused options for template: 'extra'.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
Template was not rendered::
......@@ -579,8 +550,6 @@ Removing the canary allows template to be re-rendered::
Installing template.
The template install returned None. A path or iterable os paths should be returned.
Unused options for template: 'extra'.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('foo_once')
dummy
......@@ -28,8 +28,6 @@ We run buildout::
>>> print system(join('bin', 'buildout')),
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
And the output file has been parsed by buildout itself::
......@@ -78,8 +76,6 @@ And run buildout, and see the result::
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('template.out')
template
......@@ -98,8 +94,6 @@ If the md5sum doesn't match, the buildout fail::
... md5sum = 0123456789abcdef0123456789abcdef
... ''')
>>> print system(join('bin', 'buildout')),
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
While:
Installing.
Getting section template.
......@@ -129,8 +123,6 @@ You can specify the mode of the written file::
>>> print system(join('bin', 'buildout')),
Uninstalling template.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
And the generated file with have the right permissions::
......@@ -166,8 +158,6 @@ will be installed as dependency::
foobar='dependency content'
recipe='zc.buildout:debug'
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
This way you can get options which are computed in the ``__init__`` of
the dependent recipe.
......@@ -215,12 +205,10 @@ Let's just use ``buildout.cfg`` using this egg::
... recipe = samplerecipe
... ''')
>>> print system(join('bin', 'buildout')),
Develop: ...
Develop: '/sample-buildout/.'
Uninstalling template.
Uninstalling dependency.
Installing sample.
Installing template.
Not found: /tmp/.../zc.buildout/
Not found: /tmp/.../zc.buildout/
>>> cat('template.out')
foobar
......@@ -27,6 +27,7 @@
import doctest
import unittest
from zc.buildout import testing
from zope.testing import renormalizing
def setUp(test):
testing.buildoutSetUp(test)
......@@ -38,7 +39,10 @@ def test_suite():
filename,
setUp=setUp,
tearDown=testing.buildoutTearDown,
optionflags=(doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
checker=renormalizing.RENormalizing((
testing.normalize_path,
testing.not_found,
)),
) for filename in [
'README.txt',
'README.jinja2.txt',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment