Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
frapell committed Jul 20, 2015
1 parent 4426170 commit 7190ea2
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions src/plone/recipe/zope2instance/tests/zope2instance.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,85 @@ We should have a zope instance, with the custom event log::
...
<BLANKLINE>


Disable access log
==================

If we assign `disable` to `z2-log`, the whole <logger access> section
will be omitted::

>>> write('buildout.cfg',
... '''
... [buildout]
... parts = instance
... find-links = %(sample_buildout)s/eggs
...
... [instance]
... recipe = plone.recipe.zope2instance
... eggs =
... user = me:me
...
... z2-log = disable
... ''' % options)

Let's run it::

>>> print system(join('bin', 'buildout')),
Uninstalling instance.
Installing instance.
Generated script '...instance'.
Generated interpreter '.../parts/instance/bin/interpreter'.

We should have a zope instance, with no access log::

>>> instance = os.path.join(sample_buildout, 'parts', 'instance')
>>> zope_conf = open(os.path.join(instance, 'etc', 'zope.conf')).read()
>>> zope_conf = zope_conf.replace('\\', '/')
>>> "logger access" in zope_conf
False
>>> "eventlog" in zope_conf
True


Disable events log
==================

If we assign `disable` to `event-log`, the whole <eventlog> section
will be omitted::

>>> write('buildout.cfg',
... '''
... [buildout]
... parts = instance
... find-links = %(sample_buildout)s/eggs
...
... [instance]
... recipe = plone.recipe.zope2instance
... eggs =
... user = me:me
...
... event-log = disable
... ''' % options)

Let's run it::

>>> print system(join('bin', 'buildout')),
Uninstalling instance.
Installing instance.
Generated script '...instance'.
Generated interpreter '.../parts/instance/bin/interpreter'.

We should have a zope instance, with no access log::

>>> instance = os.path.join(sample_buildout, 'parts', 'instance')
>>> zope_conf = open(os.path.join(instance, 'etc', 'zope.conf')).read()
>>> zope_conf = zope_conf.replace('\\', '/')
>>> "logger access" in zope_conf
True
>>> "eventlog" in zope_conf
False


Custom site.zcml file
=====================

Expand Down

0 comments on commit 7190ea2

Please sign in to comment.