From df6ee9b1222ebd81fa22ce3499e536abe7bcb05e Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 11 Dec 2017 13:44:42 +0100 Subject: Add python3 for Functest utils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also fixes test_utils RegexMatch and SubstrMatch. Change-Id: I124aa7d0c4110dcd2f50220aae7ba9b299799e93 Signed-off-by: Cédric Ollivier --- functest/tests/unit/test_utils.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'functest/tests/unit/test_utils.py') diff --git a/functest/tests/unit/test_utils.py b/functest/tests/unit/test_utils.py index e171db02..15904764 100644 --- a/functest/tests/unit/test_utils.py +++ b/functest/tests/unit/test_utils.py @@ -8,16 +8,22 @@ import re -class RegexMatch(str): +class RegexMatch(object): + def __init__(self, msg): + self.msg = msg + def __eq__(self, other): - match = re.search(self, other) + match = re.search(self.msg, other) if match: return True return False -class SubstrMatch(str): +class SubstrMatch(object): + def __init__(self, msg): + self.msg = msg + def __eq__(self, other): - if self in other: + if self.msg in other: return True return False -- cgit 1.2.3-korg