| 1 | Test TracLegos class and associated functions |
|---|
| 2 | ============================================= |
|---|
| 3 | |
|---|
| 4 | The 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 | |
|---|
| 12 | Test the constructor argument specification. This will have to be |
|---|
| 13 | changed if TracLegos.__init__ is changed: |
|---|
| 14 | |
|---|
| 15 | >>> sorted(TracLegos.arguments().keys()) |
|---|
| 16 | ['directory', 'inherit', 'master', 'options', 'site_templates', 'vars'] |
|---|
| 17 | |
|---|
| 18 | traclegos_argspec should use the left-most non-false value of a list |
|---|
| 19 | of 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 | |
|---|
| 28 | site_configuration should return a dictionary for every section |
|---|
| 29 | supported by site-configuration .ini files. In the case where no |
|---|
| 30 | arguments are passed, these should be empty dictionaries: |
|---|
| 31 | |
|---|
| 32 | >>> set(site_configuration().keys()) == sections |
|---|
| 33 | True |
|---|