From 5227a60383d94c8f8376394466dff2f810615091 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 23 Sep 2015 16:27:46 -0700 Subject: [PATCH] templates/index.mako: handle missing subtests correctly This patch fixes the handling of subtests when more than one result is presented. Currently this will raise a KeyError and die horribly. cc: Ilia Mirkin Signed-off-by: Dylan Baker --- templates/index.mako | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/index.mako b/templates/index.mako index 6efcd41af..d2b84b5c0 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -161,8 +161,9 @@ escape_filename(test))) else: raw = res.tests.get(grouptools.groupname(test)) - if raw is not None: - result = raw.subtests[grouptools.testname(test)] + name = grouptools.testname(test) + if raw is not None and name in raw.subtests: + result = raw.subtests[name] href = normalize_href(posixpath.join(escape_pathname(res.name), escape_filename(grouptools.groupname(test)))) else: -- GitLab