Wrote some tests around the stats conversions.

Properly named the finished parameter.

Handled the root JSON key
This commit is contained in:
Martyn Inglis
2016-08-24 10:35:04 +01:00
parent b5de1dae5e
commit 5b2ae43d5d
3 changed files with 109 additions and 16 deletions

View File

@@ -78,13 +78,14 @@ def view_job(service_id, job_id):
filter_args = _parse_filter_args(request.args)
filter_args['status'] = _set_status_filters(filter_args)
finished = (
bool(job.get('notification_count', 0) and ((
job.get('notifications_delivered', 0) +
job.get('notifications_failed', 0)
) == job.get('notification_count', 0))))
return render_template(
'views/jobs/job.html',
finished=job.get('notifications_sent', 0) and ((
job.get('notifications_sent', 0) -
job.get('notifications_delivered', 0) -
job.get('notifications_failed', 0)
) == 0),
finished=finished,
uploaded_file_name=job['original_file_name'],
template=Template(
service_api_client.get_service_template(