[Piglit] [Patch V2 4/8] status_tests: New initializer test

Dylan Baker baker.dylan.c at gmail.com
Mon Mar 10 18:25:30 PDT 2014


Due to changes in the way Status works the previous initialization tests
now only test lookup. This adds a new test that does a simple
initialization on Status()

v2: - Add this patch

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

diff --git a/framework/tests/status_tests.py b/framework/tests/status_tests.py
index 3dbcc42..da3543d 100644
--- a/framework/tests/status_tests.py
+++ b/framework/tests/status_tests.py
@@ -18,7 +18,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-""" Tests for the Status module 
+""" Tests for the Status module
 
 Note: see framework/status.py for the authoritative list of fixes, regression,
 etc
@@ -42,22 +42,24 @@ FIXES = itertools.combinations(reversed(STATUSES), 2)
 PROBLEMS = STATUSES[1:]
 
 
-def check_initialize(stat):
-    """ Initialize the object """
-    stt = status.status_lookup(stat)
-    assert stt
+def initialize_status():
+    """ status.Status inializes """
+    test = status.Status('test', 1)
+    assert test
 
 
-def test_gen_initialize():
-    """ Generator that attempts to initialize all of the status classes
+def check_lookup(stat):
+    """ Lookup a status """
+    stt = status.status_lookup(stat)
+    assert stt
 
-    This test relies on status.status_lookup working correctly
 
-    """
-    yieldable = check_initialize
+def test_gen_lookup():
+    """ Generator that attempts to do a lookup on all statuses """
+    yieldable = check_lookup
 
     for stat in STATUSES + ['skip']:
-        yieldable.description = "Initialize {}".format(stat)
+        yieldable.description = "Lookup: {}".format(stat)
         yield yieldable, stat
 
 
-- 
1.9.0



More information about the Piglit mailing list