source: traclegosscript/anyrelease/traclegos/tests/test_traclegos.txt

Last change on this file was 4320, checked in by Jeff Hammel, 15 years ago

fix test

File size: 1.2 KB
Line 
1Test TracLegos class and associated functions
2=============================================
3
4The imports:
5
6    >>> from pprint import pprint
7    >>> from traclegos.legos import sections
8    >>> from traclegos.legos import site_configuration
9    >>> from traclegos.legos import traclegos_argspec
10    >>> from traclegos.legos import TracLegos
11
12Test the constructor argument specification.  This will have to be
13changed if TracLegos.__init__ is changed:
14
15    >>> sorted(TracLegos.arguments().keys())
16    ['directory', 'inherit', 'master', 'options', 'site_templates', 'vars']
17
18traclegos_argspec should use the left-most non-false value of a list
19of dictionaries to provide the arugments to construct TracLegos:
20
21    >>> print repr(traclegos_argspec()['directory'])
22    None
23    >>> traclegos_argspec({'directory': 'foo'}, {'directory': 'bar'})['directory']
24    'bar'
25    >>> traclegos_argspec({'directory': 'foo'}, {'directory': None})['directory']
26    'foo'
27
28site_configuration should return a dictionary for every section
29supported by site-configuration .ini files.  In the case where no
30arguments are passed, these should be empty dictionaries:
31
32    >>> set(site_configuration().keys()) == sections
33    True
Note: See TracBrowser for help on using the repository browser.