From: Richard Leitner Date: Wed, 22 Aug 2018 09:22:52 +0000 (+0200) Subject: oeqa/core/decorator: add skipIfInDataVar X-Git-Tag: uninative-2.3~552 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=10b935c713748346aea6c36c2f41e0ae6c320821;p=openembedded-core.git oeqa/core/decorator: add skipIfInDataVar skipIfInDataVar will skip a test if a value is in a certain variable. Signed-off-by: Richard Leitner Signed-off-by: Richard Purdie --- 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 @@ -53,6 +53,20 @@ class skipIfNotDataVar(OETestDecorator): if not self.case.td.get(self.var) == self.value: 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): """