[Piglit] [PATCH 13/13] core_tests.py: Add tests for TestResult

Dylan Baker baker.dylan.c at gmail.com
Thu Mar 6 14:47:23 PST 2014


Specifically TestResult should convert a 'result' value into a
status.Status derived object.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/tests/core_tests.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/framework/tests/core_tests.py b/framework/tests/core_tests.py
index dc33fdf..f63184e 100644
--- a/framework/tests/core_tests.py
+++ b/framework/tests/core_tests.py
@@ -27,6 +27,7 @@ import collections
 import json
 import framework.tests.utils as utils
 import framework.core as core
+import framework.status as status
 
 
 def check_initialize(target):
@@ -143,3 +144,11 @@ def test_load_results_file():
     with utils.resultfile() as tfile:
         results = core.load_results(tfile.name)
         assert results
+
+
+def test_testresult_to_status():
+    """ TestResult initialized with result key converts the value to a Status
+    """
+    result = core.TestResult({'result': 'pass'})
+    assert isinstance(result['result'], status.Status), \
+        "Result key not converted to a status object"
-- 
1.9.0



More information about the Piglit mailing list