removed results from report and re-added timeout values

This commit is contained in:
Luis Aleixo 2023-06-02 14:44:55 +02:00
parent d04869ce16
commit a547700779
4 changed files with 19 additions and 23 deletions

View file

@ -161,25 +161,6 @@
{% block report_summary_footnote %}
{% endblock report_summary_footnote %}
</div>
<br>
<table class="table w-auto">
<thead class="thead-light">
<tr>
<th>Scenario</th>
<th>P(I)</th>
{# <th>Expected new cases</th> #}
</tr>
</thead>
<tbody>
{% for scenario_name, scenario_stats in alternative_viral_load.items() %}
<tr>
<td> Viral load: 10<sup>{{ scenario_name }}</sup></td>
<td> {{ scenario_stats | non_zero_percentage }}</td>
{# <td style="text-align:right">{{ scenario_stats.expected_new_cases | float_format }}</td> #}
</tr>
{% endfor %}
</tbody>
</table>
<br><p id="section1">* The results are based on the parameters and assumptions published in the CARA publication: <a href="https://doi.org/10.1098/rsfs.2021.0076"> doi.org/10.1098/rsfs.2021.0076</a>.</p><br>
{% if form.short_range_option == "short_range_yes" %}
{% if 'Speaking' in form.short_range_interactions|string or 'Shouting' in form.short_range_interactions|string %}

View file

@ -16,7 +16,7 @@ def test_generate_report(baseline_form) -> None:
# generate a report for it. Because this is what happens in the caimira
# calculator, we confirm that the generation happens within a reasonable
# time threshold.
time_limit: float = 30.0 # seconds
time_limit: float = 20.0 # seconds
start = time.perf_counter()

View file

@ -5,7 +5,7 @@ import tornado.testing
import caimira.apps.calculator
from caimira.apps.calculator import model_generator
_TIMEOUT = 30.
_TIMEOUT = 40.
class TestCalculatorJsonResponse(tornado.testing.AsyncHTTPTestCase):

View file

@ -7,7 +7,7 @@ from retry import retry
import caimira.apps.calculator
from caimira.apps.calculator.report_generator import generate_permalink
_TIMEOUT = 30.
_TIMEOUT = 20.
@pytest.fixture
@ -63,7 +63,7 @@ class TestBasicApp(tornado.testing.AsyncHTTPTestCase):
assert 'expected number of new cases is' in response.body.decode()
@retry(tries=20)
@retry(tries=10)
class TestCernApp(tornado.testing.AsyncHTTPTestCase):
def get_app(self):
cern_theme = Path(caimira.apps.calculator.__file__).parent.parent / 'themes' / 'cern'
@ -76,6 +76,21 @@ class TestCernApp(tornado.testing.AsyncHTTPTestCase):
assert 'expected number of new cases is' in response.body.decode()
retry(tries=10)
class TestOpenApp(tornado.testing.AsyncHTTPTestCase):
def get_app(self):
return caimira.apps.calculator.make_app(calculator_prefix="/mycalc")
@tornado.testing.gen_test(timeout=_TIMEOUT)
def test_report(self):
response = yield self.http_client.fetch(self.get_url('/mycalc/baseline-model/result'))
self.assertEqual(response.code, 200)
def test_calculator_404(self):
response = self.fetch('/calculator')
assert response.code == 404
async def test_permalink_urls(http_server_client, baseline_form):
base_url = 'proto://hostname/prefix'
permalink_data = generate_permalink(base_url, lambda: "", lambda: "/calculator", baseline_form)