[OE-core] [PATCH] oeqa/core/decorator: add skipIfInDataVar

Richard Leitner richard.leitner at skidata.com
Wed Aug 22 09:22:52 UTC 2018


skipIfInDataVar will skip a test if a value is in a certain variable.

Signed-off-by: Richard Leitner <richard.leitner at skidata.com>
---
 meta/lib/oeqa/core/decorator/data.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index 31c6dd6be7..f0f65abb39 100644
--- a/meta/lib/oeqa/core/decorator/data.py
+++ b/meta/lib/oeqa/core/decorator/data.py
@@ -54,6 +54,20 @@ class skipIfNotDataVar(OETestDecorator):
             self.case.skipTest(self.msg)
 
 @registerDecorator
+class skipIfInDataVar(OETestDecorator):
+    """
+        Skip test if value is in data store's variable.
+    """
+
+    attrs = ('var', 'value', 'msg')
+    def setUpDecorator(self):
+        msg = ('Checking if %r value contains %r to skip '
+              'the test' % (self.var, self.value))
+        self.logger.debug(msg)
+        if self.value in (self.case.td.get(self.var)):
+            self.case.skipTest(self.msg)
+
+ at registerDecorator
 class skipIfNotInDataVar(OETestDecorator):
     """
         Skip test if value is not in data store's variable.
-- 
2.11.0




More information about the Openembedded-core mailing list