aboutsummaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Leitner <richard.leitner@skidata.com>2018-08-22 11:22:52 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-23 18:02:19 +0100
commit10b935c713748346aea6c36c2f41e0ae6c320821 (patch)
tree7e93f905ecf1b91fd4db39707db5d26da259d2ce /meta
parent24faf8b9bbee82033d5f636f254e59b8d3d31ea5 (diff)
downloadopenembedded-core-contrib-10b935c713748346aea6c36c2f41e0ae6c320821.tar.gz
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@skidata.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/core/decorator/data.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index 31c6dd6be7d..f0f65abb39a 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)
+
+@registerDecorator
class skipIfNotInDataVar(OETestDecorator):
"""
Skip test if value is not in data store's variable.