diff options
| author | Richard Leitner <richard.leitner@skidata.com> | 2018-08-22 11:22:52 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-23 18:02:23 +0100 |
| commit | a0de8a6fb892dc5625ff145e33ff2ccfff4f7e88 (patch) | |
| tree | 82b0cf31c59e996511a45d5b1cb5422a2808897a /meta/lib/oeqa | |
| parent | 6185e3d23c23f50439a898428b90dcd43fa7a8b6 (diff) | |
| download | poky-a0de8a6fb892dc5625ff145e33ff2ccfff4f7e88.tar.gz | |
oeqa/core/decorator: add skipIfInDataVar
skipIfInDataVar will skip a test if a value is in a certain variable.
(From OE-Core rev: 10b935c713748346aea6c36c2f41e0ae6c320821)
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
| -rw-r--r-- | meta/lib/oeqa/core/decorator/data.py | 14 |
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 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): | |||
| 54 | self.case.skipTest(self.msg) | 54 | self.case.skipTest(self.msg) |
| 55 | 55 | ||
| 56 | @registerDecorator | 56 | @registerDecorator |
| 57 | class skipIfInDataVar(OETestDecorator): | ||
| 58 | """ | ||
| 59 | Skip test if value is in data store's variable. | ||
| 60 | """ | ||
| 61 | |||
| 62 | attrs = ('var', 'value', 'msg') | ||
| 63 | def setUpDecorator(self): | ||
| 64 | msg = ('Checking if %r value contains %r to skip ' | ||
| 65 | 'the test' % (self.var, self.value)) | ||
| 66 | self.logger.debug(msg) | ||
| 67 | if self.value in (self.case.td.get(self.var)): | ||
| 68 | self.case.skipTest(self.msg) | ||
| 69 | |||
| 70 | @registerDecorator | ||
| 57 | class skipIfNotInDataVar(OETestDecorator): | 71 | class skipIfNotInDataVar(OETestDecorator): |
| 58 | """ | 72 | """ |
| 59 | Skip test if value is not in data store's variable. | 73 | Skip test if value is not in data store's variable. |
