- extract, isolate and package it in a completely independent Python module, versioned and in a way that allows releases on PyPI.org - fixed error in placeholder for secondary school (data registry defaults) - added restriction in pytest version to install - expected number of new cases fix - data registry update (schema v2.1.1) - github update - deprecate ExpertApplication and CO2Application - changes to reflect schema update 2.0.2 - version update - Fixed error with f_inf (short-range) - new folder layout - Conditional probability data update - General fixes - Fitting results in L/S/person - CO2 fitting algorithm refinement
30 lines
717 B
Python
30 lines
717 B
Python
import textwrap
|
|
|
|
import jinja2
|
|
import pytest
|
|
|
|
import cern_caimira.apps.calculator.markdown_tools as md_tools
|
|
|
|
|
|
@pytest.fixture
|
|
def example_template():
|
|
return jinja2.Environment().from_string(textwrap.dedent("""
|
|
# A header
|
|
|
|
Some *text*
|
|
|
|
{% block using_jinja_blocks %}
|
|
# Another header
|
|
|
|
Some more **text**.
|
|
{% endblock %}
|
|
|
|
"""))
|
|
|
|
|
|
def test_extract_blocks(example_template):
|
|
blocks = md_tools.extract_rendered_markdown_blocks(example_template)
|
|
assert 'A header' in blocks
|
|
assert blocks['A header'] == '<p>Some <em>text</em></p>\n'
|
|
assert 'Another header' in blocks
|
|
assert blocks['Another header'] == '<p>Some more <strong>text</strong>.</p>\n'
|