[Piglit] [Patch V2 5/8] framework/tests/status.py: Add test for status in list syntax

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


Currently a comparison like this will raise an error:
framework.status.PASS in ['pass']

This test currently fails, and is fixed by another patch in this series

v2: - update this test to work with constant statuses

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

diff --git a/framework/tests/status_tests.py b/framework/tests/status_tests.py
index da3543d..3529036 100644
--- a/framework/tests/status_tests.py
+++ b/framework/tests/status_tests.py
@@ -63,6 +63,14 @@ def test_gen_lookup():
         yield yieldable, stat
 
 
+def test_status_in():
+    """ A status can be compared to a str with `x in container` syntax """
+    stat = status.PASS
+    slist = ['pass']
+
+    assert stat in slist
+
+
 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