when loading macros from imported files
the base property of the node is
overwritten.
this adds a xml:base property to the node
which is printed in the test
1. allow that the name of nested macros can be controlled by tokens:
eg `<expand macro="@TOKEN_NAME@"/>`
therefore:
- in load_with_references childs of the macros element are
temporarily removed. otherwise the replacement of the nested macros
also happens for the expand tags in macros and it seems really
difficult to iterate a tree excepting a subtree
- in _expand_macro replace tokens first and then consider
nested macros
see test test_loader_specify_nested_macro_by_token
2. allow token expansion also for attributes (before only attribute
values)
this only works if the token is valid xml i.e. they can't be surrounded
by `@`
see test test_loader_token_attribute_name
3. split unit tests in separate functions
and add a few (e.g. nested tokens ...)
Upgrade syntax using `pyupgrade --py36-plus` .
Manually drop several `six` imports.
Also:
- Remove broken pr_cache in scripts/bootstrap_history.py
- Fix broken prefix removal in lib/galaxy/tool_util/deps/mulled/mulled_build.py
This replaces a previous (now closed) PR:
https://github.com/galaxyproject/galaxy/pull/8279
A few changes:
- tests for code in galaxy/tool_util moved under test/unit/tool_util
- common parts (used in both tools and tool_util) factored out into
unittest_utils/sample_data.py
- symlink to sample_data.py in test/unit/tool_util/ is needed to make
the tool_util package tests run. This is not an ideal solution, but it
avoids duplication of the sample data used by tests in tools/ and
tool_util/.