From 7adee3bf138d3735f584a47d822676e82e7f5d00 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 12 Jan 2022 20:46:30 +0100 Subject: [PATCH] add test for the limited recursion possibilities --- lib/galaxy/util/xml_macros.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/galaxy/util/xml_macros.py b/lib/galaxy/util/xml_macros.py index 3b78da239c2b..2a895dfe514d 100644 --- a/lib/galaxy/util/xml_macros.py +++ b/lib/galaxy/util/xml_macros.py @@ -224,6 +224,33 @@ def _expand_yield_statements(macro_def, expand_el): + >>> # test recursion like replacements + >>> expand_el = XML(''' + ... + ... + ... + ... + ... + ... + ... + ... + ... ''') + >>> macro_def = XML(''' + ... + ... + ... ''') + >>> _expand_yield_statements(macro_def, expand_el) + >>> print(xml_to_string(macro_def, pretty=True)) + + + + + + + + + + """ # replace named yields for token_el in expand_el.findall('./token'):