Detailed tests of prerelease.py
===============================

.. :doctest:
.. :setup: zest.releaser.tests.functional.setup
.. :teardown: zest.releaser.tests.functional.teardown

Several items are prepared for us.

An svn repository:

    >>> repo_url
    'file://TESTREPO'

An svn checkout of a project:

    >>> svnsourcedir
    'TESTTEMP/tha.example-svn'
    >>> import os
    >>> os.chdir(svnsourcedir)
    >>> from zest.releaser.utils import system
    >>> print system("svn info %s" % svnsourcedir)
    Path: ...
    URL: file://TESTREPO/tha.example/trunk
    ...

The version is at 0.1.dev0:

    >>> svnhead('setup.py')
    from setuptools import setup, find_packages
    import os.path
    <BLANKLINE>
    version = '0.1.dev0'

Asking input on the prompt is not unittestable unless we use the prepared
testing hack in utils.py:

    >>> from zest.releaser import utils
    >>> utils.TESTMODE = True

Run the prerelease script:

    >>> utils.answers_for_testing = ['', '']
    >>> from zest.releaser import prerelease
    >>> prerelease.main()
    Question: Enter version [0.1]:
    Our reply: <ENTER>
    Checking data dict
    Question: OK to commit this (Y/n)?
    Our reply: <ENTER>

The changelog and setup.py are at 0.1 and indicate a release date:

    >>> svnhead('CHANGES.txt')
    Changelog of tha.example
    =====================
    <BLANKLINE>
    0.1 (...-...-...)
    ----------------
    >>> svnhead('setup.py')
    from setuptools import setup, find_packages
    import os.path
    <BLANKLINE>
    version = '0.1'
