Tests
=====

We'll start by creating a buildout that uses the recipe::

    >>> write('buildout.cfg',
    ... """
    ... [buildout]
    ... parts = haproxy
    ...
    ... [haproxy]
    ... recipe = plone.recipe.haproxy
    ... """)

    >>> print system(buildout)
    Installing haproxy.
    haproxy: Downloading http://dist.plone.org/thirdparty/...
    haproxy: Unpacking and configuring
    ...
    haproxy: Adding script wrapper for haproxy
    ...

Running the buildout with a known bad URL gives us::

    >>> write('buildout.cfg',
    ... """
    ... [buildout]
    ... parts = haproxy
    ...
    ... [haproxy]
    ... recipe = plone.recipe.haproxy
    ... url = %(url)s
    ... """ % { 'url' : 'http://dist.plone.org/thirdparty/yxorpah-1.3.22.zip'})

    >>> print system(buildout)
    Uninstalling haproxy.
    Installing haproxy.
    haproxy: Downloading http://dist.plone.org/thirdparty/yxorpah-1.3.22.zip
    While:
      Installing haproxy.
    <BLANKLINE>
    An internal error occured due to a bug in either zc.buildout or in a
    recipe being used:
    Traceback (most recent call last):
    ...
    HTTPError: HTTP Error 404: Not Found
    <BLANKLINE>
