[Piglit] [PATCH 2/7] framework/tests/status_tests.py: add initialization tests

Dylan Baker baker.dylan.c at gmail.com
Fri Feb 28 15:42:58 PST 2014


Just a few simple tests to ensure that the various status classes
initialize.

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

diff --git a/framework/tests/status_tests.py b/framework/tests/status_tests.py
index cdc9989..3dbcc42 100644
--- a/framework/tests/status_tests.py
+++ b/framework/tests/status_tests.py
@@ -42,6 +42,25 @@ FIXES = itertools.combinations(reversed(STATUSES), 2)
 PROBLEMS = STATUSES[1:]
 
 
+def check_initialize(stat):
+    """ Initialize the object """
+    stt = status.status_lookup(stat)
+    assert stt
+
+
+def test_gen_initialize():
+    """ Generator that attempts to initialize all of the status classes
+
+    This test relies on status.status_lookup working correctly
+
+    """
+    yieldable = check_initialize
+
+    for stat in STATUSES + ['skip']:
+        yieldable.description = "Initialize {}".format(stat)
+        yield yieldable, stat
+
+
 def is_regression(x, y):
     # Test for regressions
     assert status.status_lookup(x) < status.status_lookup(y)
-- 
1.9.0



More information about the Piglit mailing list