Commit Graph
5 Commits
Author SHA1 Message Date
John Chilton 8ac5eb98a5 PEP-8 fixes for entire test/unit/tools module.
Add the module to .ci/pep8_sources.txt.
2015-06-23 20:07:27 -04:00
John Chilton 654ffe97ea Update out-dated comment in test_tool_loader. 2015-06-22 10:25:43 -04:00
John Chilton 711d4bb2c5 Modify XML macro parameters to allow arbitrary wrap string.
Previously there were two hard-coded toke types at_tokens an dollar_tokens. Now all tokens for the same macro must have the same wrap string and this string can be set arbitrarily with token_quote attribute. The defualt token_quote value is @.
2015-06-18 14:39:57 -04:00
John Chilton 1de2d73f38 Allow parameterization of XML macros.
This comes in two modes - simple lists of required attributes and per-attribute parameters that may specify defaults.

The following toy example:

```
<tool>
    <expand macro="inputs" bar="hello" />
    <macros>
        <xml name="inputs" dollar_tokens="bar">
            <inputs type="the type is $BAR$" />
        </xml>
    </macros>
</tool>
```

will evalute to ``<tool><inputs type="the type is hello" /><tool>``. The XML macro definition tag can now take in two new fixed attributes dollar_tokens and at_tokens - which will be interpreted as a list of parameter names. Each parameter can be specified when expanding the macros as simple attributes specifying the value of the parameter. The "dollar" parameter with name bar would map to a token with name $BAR$. Likewise an "at" parameter with name foo would map to a token with name @FOO@.

Both parameter types can be specified on a per-parameter basis to also specify default values. So the following example:

```
<tool>
    <expand macro="inputs" foo="hello" />
    <expand macro="inputs" foo="world" />
    <expand macro="inputs" />
    <macros>
        <xml name="inputs" at_token_foo="the_default">
            <inputs>@FOO@</inputs>
        </xml>
    </macros>
</tool>
```

Would evalute to ``<tool><inputs>hello</inputs><inputs>world</inputs><inputs>the_default</inputs>``.

Updated unit tests explain the above much more succinctly - though some like English and words for reasons that escape me.
2015-06-18 14:35:33 -04:00
John Chilton f661553201 Rearrange unit tests.
Move tests that were in tests/unit but could logically be placed into tests/unit/tools or tests/unit/jobs into these directory.
2014-02-21 22:09:57 -06:00