summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-11-04 12:31:19 -0700
committerDylan Baker <dylan@pnwbakers.com>2016-11-04 13:06:27 -0700
commit3ba2ddd3a8b71ca7420fa10e9ad5a0415e197ca3 (patch)
treeff88e5daf3b7cb51cba32493432d306d04fc1ff6 /unittests
parent7360914582e6f79d0652bea660c1b652bb5335eb (diff)
framework/backends/json: Handle updating results without pid field
If it's not present make it an empty list. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Tested-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'unittests')
-rw-r--r--unittests/framework/backends/test_json_update.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/unittests/framework/backends/test_json_update.py b/unittests/framework/backends/test_json_update.py
index c8e3ee6a9..29ca19a50 100644
--- a/unittests/framework/backends/test_json_update.py
+++ b/unittests/framework/backends/test_json_update.py
@@ -173,6 +173,26 @@ class TestV8toV9(object):
'__type__': 'Subtests',
},
'exception': None,
+ },
+ 'b@test': {
+ "time": {
+ 'start': 1.2,
+ 'end': 1.8,
+ '__type__': 'TimeAttribute'
+ },
+ 'dmesg': '',
+ 'result': 'fail',
+ '__type__': 'TestResult',
+ 'command': '/a/command',
+ 'traceback': None,
+ 'out': '',
+ 'environment': 'A=variable',
+ 'returncode': 0,
+ 'err': '',
+ 'subtests': {
+ '__type__': 'Subtests',
+ },
+ 'exception': None,
}
},
"time_elapsed": {
@@ -193,6 +213,9 @@ class TestV8toV9(object):
def test_pid(self, result):
assert result['tests']['a@test']['pid'] == [5]
+ def test_no_pid(self, result):
+ assert result['tests']['b@test']['pid'] == []
+
def test_valid(self, result):
with open(os.path.join(os.path.dirname(__file__), 'schema',
'piglit-9.json'),