diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-08-04 11:07:05 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-08-04 11:07:05 +0800 |
commit | 488a342ede61f38af476746febda26e4a2ca5dcd (patch) | |
tree | 01eac35cffc2f6be8a873e11e0c2e20fed77f762 /ci | |
parent | 8f3ad08c40bd8977651794f6720eda5df61b0c26 (diff) |
support "" equals to None check in Testcase.is_compatible
when check ci_installer/ci_scenario is None, we also check if ci_installer/ci_scenario is ""
JIRA: FUNCTEST-404
Change-Id: Ib8b7b9a98f6eb064d2b3648e5d1334990c69cb2f
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'ci')
-rw-r--r-- | ci/tier_handler.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ci/tier_handler.py b/ci/tier_handler.py index e50fbe6f..1eadfba5 100644 --- a/ci/tier_handler.py +++ b/ci/tier_handler.py @@ -111,17 +111,21 @@ class TestCase: self.criteria = criteria self.blocking = blocking + @staticmethod + def is_none(item): + return item is None or item is "" + def is_compatible(self, ci_installer, ci_scenario): try: - if ci_installer is not None: + if not self.is_none(ci_installer): if re.search(self.dependency.get_installer(), ci_installer) is None: return False - if ci_scenario is not None: + if not self.is_none(ci_scenario): if re.search(self.dependency.get_scenario(), ci_scenario) is None: return False - return not (ci_scenario is None and ci_installer is None) + return True except TypeError: return False |