summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/decorator/oeid.py
blob: ea8017a55a18aee392911a8859a64eeb367849e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright (C) 2016 Intel Corporation
# Released under the MIT license (see COPYING.MIT)

from . import OETestFilter, registerDecorator
from oeqa.core.utils.misc import intToList

def _idFilter(oeid, filters):
     return False if oeid in filters else True

@registerDecorator
class OETestID(OETestFilter):
    attrs = ('oeid',)

    def bind(self, registry, case):
        super(OETestID, self).bind(registry, case)

    def filtrate(self, filters):
        if filters.get('oeid'):
            filterx = intToList(filters['oeid'], 'oeid')
            del filters['oeid']
            if _idFilter(self.oeid, filterx):
                return True
        return False