summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-08-03 17:55:07 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2015-09-22 14:45:48 -0700
commitb365367f43ce239092851a6b9a2a152628b08c8b (patch)
treeed1a1493498896c39cc299aceb5c1de15c90207c /templates
parent9b39f0c3a706448e2fd4661621c5c46c5b397f38 (diff)
framework: replace TestResult dict with an object
This is a very invasive patch, because it replaces one of our core data-structures with a completely different kind of object. This new object is not a dict-like object (it doesn't use obj[key] = value syntax), instead it's a standard object with the standard object attributes. So result['time'] becomes result.time. This approach has a couple of advantages. First, it allows us to use properties, which allows us to encapsulate a lot of distributed logic from the summary module in the results module, and in a way that is easier to test for correctness. The second advantage of that encapsulation is that correct behavior is used everywhere, instead of just in most places. Finally, it allows us to use the flyweight pattern on the results objects, limiting the amount of memory consumed. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/test_result.mako24
1 files changed, 12 insertions, 12 deletions
diff --git a/templates/test_result.mako b/templates/test_result.mako
index 7baf05c0d..f08810a1d 100644
--- a/templates/test_result.mako
+++ b/templates/test_result.mako
@@ -11,7 +11,7 @@
<h1>Results for ${testname}</h1>
<h2>Overview</h2>
<div>
- <p><b>Result:</b> ${value.get('status', 'None')}</p>
+ <p><b>Result:</b> ${value.result}</p>
</div>
<p><a href="${index}">Back to summary</a></p>
<h2>Details</h2>
@@ -22,13 +22,13 @@
</tr>
<tr>
<td>Returncode</td>
- <td>${value.get('returncode', 'None')}</td>
+ <td>${value.returncode}</td>
</tr>
<tr>
<td>Time</td>
- <td>${value.get('time', 'None')}</b>
+ <td>${value.time}</b>
</tr>
- % if value.get('images', None):
+ % if value.images:
<tr>
<td>Images</td>
<td>
@@ -52,41 +52,41 @@
<tr>
<td>Stdout</td>
<td>
- <pre>${value.get('out', 'None') | h}</pre>
+ <pre>${value.out | h}</pre>
</td>
</tr>
<tr>
<td>Stderr</td>
<td>
- <pre>${value.get('err', 'None') | h}</pre>
+ <pre>${value.err | h}</pre>
</td>
</tr>
- % if value.get('environment') is not None:
+ % if value.environment:
<tr>
<td>Environment</td>
<td>
- <pre>${value.get('environment') | h}</pre>
+ <pre>${value.environment | h}</pre>
</td>
</tr>
% endif
<tr>
<td>Command</td>
<td>
- </pre>${value.get('command', 'None')}</pre>
+ </pre>${value.command}</pre>
</td>
</tr>
- % if value.get('traceback') is not None:
+ % if value.traceback:
<tr>
<td>Traceback</td>
<td>
- <pre>${value.get('traceback') | h}</pre>
+ <pre>${value.traceback | h}</pre>
</td>
</tr>
% endif
<tr>
<td>dmesg</td>
<td>
- <pre>${value.get('dmesg', 'None') | h}</pre>
+ <pre>${value.dmesg | h}</pre>
</td>
</tr>
</table>