Mercurial > mozilla > hg > licenser
view tests/doctest.txt @ 27:7e0c931a201d
web licenser now works
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 25 Nov 2011 00:57:38 -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