Commit Graph
18 Commits
Author SHA1 Message Date
Nicola Soranzo f8bd5d4bea Merge branch 'release_22.01' into dev 2022-02-21 17:00:55 +00:00
Matthias Bernt 1204647e82 do not store base at nodes 2022-02-14 19:55:49 +01:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
Matthias Bernt 9d6bfad255 adapt tool loader test
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
2022-01-26 20:51:39 +01:00
Matthias Bernt 180ed75760 check for cycles in nested macros 2022-01-14 11:47:02 +01:00
Matthias Bernt 372439c088 fix tool loader if no macros are present
and add unit test for this case
2022-01-14 09:56:30 +01:00
Matthias Bernt 068f015bb4 some more extensions for xml macros
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 ...)
2022-01-13 22:10:45 +01:00
Matthias Bernt 7c64721e22 move doctests to unit tests 2022-01-13 13:42:52 +01:00
Matthias Bernt c1604f509b use more xpath in test_tool_loader
got myself used to the unit test and thought it might be nice
to use more xpath

undo a unnecessary change in xml_macros.py
2022-01-13 11:06:44 +01:00
John Chilton 89e41b34d3 Fix unit test dependencies around tool_util sample data. 2021-09-24 14:09:25 -04:00
Sergey Golitsynskiy 0b094438e0 Enable pytest class-based tests; add flag if n/a 2021-06-01 12:30:25 -04:00
Nicola Soranzo 9d74bba7fb Drop support for retired Python 3.5
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
2020-10-07 11:52:13 +01:00
mvdbeek 69b1f86024 Add in-code test for 8805 2019-10-15 12:56:37 +02:00
Martin CechandNicola Soranzo cef66191c7 remove debug
Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com>
2019-08-08 09:22:57 -04:00
Martin CechandNicola Soranzo 2a048300c1 fix typo
Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com>
2019-08-08 09:22:40 -04:00
John Chilton d9100e25f3 Add more tests for XML macro expansion. 2019-08-07 14:30:41 -04:00
Sergey Golitsynskiy 65490868fb Fix linting errors 2019-07-16 20:54:01 -04:00
Sergey Golitsynskiy 0e4e1d9249 Restructure unit tests for tool_util package
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/.
2019-07-16 20:15:45 -04:00