[oe-commits] [openembedded-core] 13/21: oeqa/core/decorator: add skipIfInDataVar

git at git.openembedded.org git at git.openembedded.org
Thu Aug 23 08:13:43 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e31759f7acef1de1a058e6b02a5008e6b20171db
Author: Richard Leitner <richard.leitner at skidata.com>
AuthorDate: Wed Aug 22 11:22:52 2018 +0200

    oeqa/core/decorator: add skipIfInDataVar
    
    skipIfInDataVar will skip a test if a value is in a certain variable.
    
    Signed-off-by: Richard Leitner <richard.leitner at skidata.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 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 31c6dd6..f0f65ab 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.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list