diff options
| -rw-r--r-- | meta/lib/oeqa/core/decorator/data.py | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py index fdeba9fe1d..ff7bdd98b7 100644 --- a/meta/lib/oeqa/core/decorator/data.py +++ b/meta/lib/oeqa/core/decorator/data.py | |||
| @@ -28,12 +28,46 @@ class skipIfDataVar(OETestDecorator): | |||
| 28 | attrs = ('var', 'value', 'msg') | 28 | attrs = ('var', 'value', 'msg') |
| 29 | 29 | ||
| 30 | def setUpDecorator(self): | 30 | def setUpDecorator(self): |
| 31 | msg = 'Checking if %r value is %r to skip test' % (self.var, self.value) | 31 | msg = ('Checking if %r value is %r to skip test' % |
| 32 | (self.var, self.value)) | ||
| 32 | self.logger.debug(msg) | 33 | self.logger.debug(msg) |
| 33 | if self.case.td.get(self.var) == self.value: | 34 | if self.case.td.get(self.var) == self.value: |
| 34 | self.case.skipTest(self.msg) | 35 | self.case.skipTest(self.msg) |
| 35 | 36 | ||
| 36 | @registerDecorator | 37 | @registerDecorator |
| 38 | class skipIfNotDataVar(OETestDecorator): | ||
| 39 | """ | ||
| 40 | Skip test based on value of a data store's variable. | ||
| 41 | |||
| 42 | It will get the info of var from the data store and will | ||
| 43 | check it against value; if are not equal it will skip the | ||
| 44 | test with msg as the reason. | ||
| 45 | """ | ||
| 46 | |||
| 47 | attrs = ('var', 'value', 'msg') | ||
| 48 | |||
| 49 | def setUpDecorator(self): | ||
| 50 | msg = ('Checking if %r value is not %r to skip test' % | ||
| 51 | (self.var, self.value)) | ||
| 52 | self.logger.debug(msg) | ||
| 53 | if not self.case.td.get(self.var) == self.value: | ||
| 54 | self.case.skipTest(self.msg) | ||
| 55 | |||
| 56 | @registerDecorator | ||
| 57 | class skipIfNotInDataVar(OETestDecorator): | ||
| 58 | """ | ||
| 59 | Skip test if value is not in data store's variable. | ||
| 60 | """ | ||
| 61 | |||
| 62 | attrs = ('var', 'value', 'msg') | ||
| 63 | def setUpDecorator(self): | ||
| 64 | msg = ('Checking if %r value is in %r to run ' | ||
| 65 | 'the test' % (self.var, self.value)) | ||
| 66 | self.logger.debug(msg) | ||
| 67 | if not self.value in self.case.td.get(self.var): | ||
| 68 | self.case.skipTest(self.msg) | ||
| 69 | |||
| 70 | @registerDecorator | ||
| 37 | class OETestDataDepends(OETestDecorator): | 71 | class OETestDataDepends(OETestDecorator): |
| 38 | attrs = ('td_depends',) | 72 | attrs = ('td_depends',) |
| 39 | 73 | ||
