view tests/doctest.txt @ 28:eb3749dbdbf5 default tip

finish web handler
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 25 Nov 2011 17:30:28 -0800
parents d3e3a506dd29
children
line wrap: on
line source

Test licenser
================

The obligatory imports::

    >>> import licenser
    >>> from licenser import licenses
    >>> import os

Sanity check::

    >>> assert os.path.exists(directory)
    >>> files = ['main.c', 'python_script.py']
    >>> files = [os.path.join(directory, f) for f in files]    

Test MPL license::

    >>> license = licenses.MPL()
    >>> for f in files:
    ...     license.has_license(f)
    False
    False
    >>> variables = {'author': 'Jeff Hammel', 'email': 'k0s@k0s.org'}
    >>> variables = license.obtain_variables(**variables)
    >>> license.interpolate(directory, variables)

Assert files get licensed::

    >>> for f in files:
    ...     license.has_license(f)
    True
    True