2025-02-05 11:54:55 +01:00
|
|
|
{% extends "_base/class.html.jinja" %}
|
2025-02-05 11:39:09 +01:00
|
|
|
{% set anta_test = namespace(found=false) %}
|
2025-02-05 11:55:22 +01:00
|
|
|
{% set anta_test_input_model = namespace(found=false) %}
|
2025-02-05 11:39:09 +01:00
|
|
|
{% for base in class.bases %}
|
|
|
|
{% set basestr = base | string %}
|
|
|
|
{% if "AntaTest" == basestr %}
|
|
|
|
{% set anta_test.found = True %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2025-02-05 11:55:22 +01:00
|
|
|
{# TODO make this nicer #}
|
|
|
|
{% if class.parent.parent.name == "input_models" or class.parent.parent.parent.name == "input_models" %}
|
|
|
|
{% set anta_test_input_model.found = True %}
|
|
|
|
{% endif %}
|
2025-02-05 11:39:09 +01:00
|
|
|
{% block children %}
|
|
|
|
{% if anta_test.found %}
|
|
|
|
{% set root = False %}
|
|
|
|
{% set heading_level = heading_level + 1 %}
|
2025-02-05 11:54:55 +01:00
|
|
|
{% include "anta_test.html.jinja" with context %}
|
2025-02-05 11:39:09 +01:00
|
|
|
{# render source after children - TODO make add flag to respect disabling it.. though do we want to disable?#}
|
2025-02-05 11:55:22 +01:00
|
|
|
<details class="quote">
|
|
|
|
<summary>Source code in <code>
|
|
|
|
{%- if class.relative_filepath.is_absolute() -%}
|
|
|
|
{{ class.relative_package_filepath }}
|
|
|
|
{%- else -%}
|
|
|
|
{{ class.relative_filepath }}
|
|
|
|
{%- endif -%}
|
|
|
|
</code></summary>
|
|
|
|
{{ class.source|highlight(language="python", linestart=class.lineno, linenums=True) }}
|
|
|
|
</details>
|
|
|
|
{% elif anta_test_input_model.found %}
|
|
|
|
{% set root = False %}
|
|
|
|
{% set heading_level = heading_level + 1 %}
|
|
|
|
{% include "anta_test_input_model.html.jinja" with context %}
|
|
|
|
{# render source after children - TODO make add flag to respect disabling it.. though do we want to disable?#}
|
|
|
|
<details class="quote">
|
|
|
|
<summary>Source code in <code>
|
|
|
|
{%- if class.relative_filepath.is_absolute() -%}
|
|
|
|
{{ class.relative_package_filepath }}
|
|
|
|
{%- else -%}
|
|
|
|
{{ class.relative_filepath }}
|
|
|
|
{%- endif -%}
|
|
|
|
</code></summary>
|
|
|
|
{{ class.source|highlight(language="python", linestart=class.lineno, linenums=True) }}
|
2025-02-05 11:39:09 +01:00
|
|
|
</details>
|
|
|
|
{% else %}
|
|
|
|
{{ super() }}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock children %}
|
|
|
|
|
|
|
|
{# Do not render source before children for AntaTest #}
|
|
|
|
{% block source %}
|
2025-02-05 11:55:22 +01:00
|
|
|
{% if not anta_test.found and not anta_test_input_model%}
|
2025-02-05 11:39:09 +01:00
|
|
|
{{ super() }}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock source %}
|
2025-02-05 11:55:22 +01:00
|
|
|
|
|
|
|
{# overwrite block base to render some stuff on deprecation for anta_test #}
|
|
|
|
{% block bases %}
|
|
|
|
{{ super() }}
|
|
|
|
|
|
|
|
{% for dec in class.decorators %}
|
|
|
|
{% if dec.value.function.name == "deprecated_test_class" %}
|
|
|
|
<img alt="Static Badge" src="https://img.shields.io/badge/DEPRECATED-yellow?style=flat&logoSize=auto">
|
|
|
|
{% for arg in dec.value.arguments | selectattr("name", "equalto", "removal_in_version") | list %}
|
|
|
|
<img alt="Static Badge" src="https://img.shields.io/badge/REMOVAL-{{ arg.value[1:-1] }}-grey?style=flat&logoSize=auto&labelColor=red">
|
|
|
|
{% endfor %}
|
|
|
|
<br/>
|
|
|
|
{% for arg in dec.value.arguments | selectattr("name", "equalto", "new_tests") | list %}
|
|
|
|
<strong>Replaced with:</strong> {{ arg.value.elements | map("replace", "'", "<code>", 1) | map("replace", "'", "</code>", 1) | join(", ") | safe }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endblock bases %}
|