diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2015-10-07 23:38:38 -0700 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2015-10-08 13:57:41 -0700 |
commit | c22225af56e880193c1fc90e667dbd1048f9cc3e (patch) | |
tree | d2081e1c206b196844d1db92a1e8f829d40c5ee6 | |
parent | 878fa4eb89236875cae132d8633aa6245e895cda (diff) |
framework/tests/json_results_update_tests.py: make test more robust
This makes the test that tries to run a version 1 result to <current
version> more robust by always trying to update to whatever the latest
is.
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r-- | framework/tests/json_results_update_tests.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/framework/tests/json_results_update_tests.py b/framework/tests/json_results_update_tests.py index 9ae1102a4..f89d65f42 100644 --- a/framework/tests/json_results_update_tests.py +++ b/framework/tests/json_results_update_tests.py @@ -278,6 +278,18 @@ class TestV0toV1(object): with open(t, 'r') as f: backends.json._update_zero_to_one(backends.json._load(f)) + @utils.DocFormatter({'current': backends.json.CURRENT_JSON_VERSION}) + def test_load_results(self): + """backends.json.update_results (1 -> {current}): load_results properly updates""" + with utils.tempdir() as d: + tempfile = os.path.join(d, 'results.json') + with open(tempfile, 'w') as f: + json.dump(self.DATA, f, default=backends.json.piglit_encoder) + with open(tempfile, 'r') as f: + result = backends.json.load_results(tempfile, 'none') + nt.eq_(result.results_version, + backends.json.CURRENT_JSON_VERSION) + class TestV2Update(object): """Test V1 to V2 of results.""" @@ -740,12 +752,3 @@ class TestV6toV7(object): """backends.json.update_results (6 -> 7): Totals are populated""" nt.ok_(self.result.totals != {}) - def test_load_results(self): - """backends.json.update_results (6 -> 7): load_results properly updates.""" - with utils.tempdir() as d: - tempfile = os.path.join(d, 'results.json') - with open(tempfile, 'w') as f: - json.dump(self.DATA, f, default=backends.json.piglit_encoder) - with open(tempfile, 'r') as f: - result = backends.json.load_results(tempfile, 'none') - nt.eq_(result.results_version, 7) |