diff options
author | Panagiotis Karalis <panos.pkaralis@gmail.com> | 2019-08-07 10:46:52 +0300 |
---|---|---|
committer | Dan Xu <xudan16@huawei.com> | 2019-09-16 06:45:00 +0000 |
commit | 005d868d68dbb0e70b3f92a685ea269c4f646fd7 (patch) | |
tree | dcb1f0f64606b58f0c33e9dc96131fdbe4ed6398 /dovetail/testcase.py | |
parent | f0c44b1ae02ffbdb87da81dac7b6754c641d8c04 (diff) |
Move the proj to python3
The aim of this patch is to upgrade python version
of this project from python2 to python3.
Signed-off-by: Panagiotis Karalis <panos.pkaralis@gmail.com>
Change-Id: I3d3ef01176fda1b23a0542a24625be2f3368c40e
Diffstat (limited to 'dovetail/testcase.py')
-rw-r--r-- | dovetail/testcase.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/dovetail/testcase.py b/dovetail/testcase.py index 3856b137..b07a878b 100644 --- a/dovetail/testcase.py +++ b/dovetail/testcase.py @@ -13,11 +13,11 @@ import os import yaml from dovetail import constants -from parser import Parser -from test_runner import TestRunnerFactory -from utils.dovetail_config import DovetailConfig as dt_cfg -import utils.dovetail_logger as dt_logger -import utils.dovetail_utils as dt_utils +from dovetail.parser import Parser +from dovetail.test_runner import TestRunnerFactory +from dovetail.utils.dovetail_config import DovetailConfig as dt_cfg +import dovetail.utils.dovetail_logger as dt_logger +import dovetail.utils.dovetail_utils as dt_utils class Testcase(object): @@ -25,7 +25,7 @@ class Testcase(object): logger = None def __init__(self, testcase_yaml): - self.testcase = testcase_yaml.values()[0] + self.testcase = list(testcase_yaml.values())[0] self.testcase['passed'] = 'FAIL' self.cmds = [] self.sub_testcase_status = {} @@ -197,10 +197,11 @@ class Testcase(object): for testcase_file in files: with open(os.path.join(root, testcase_file)) as f: testcase_yaml = yaml.safe_load(f) - case_type = testcase_yaml.values()[0]['validate']['type'] + case_type = \ + list(testcase_yaml.values())[0]['validate']['type'] testcase = TestcaseFactory.create(case_type, testcase_yaml) if testcase is not None: - cls.testcase_list[next(testcase_yaml.iterkeys())] = \ + cls.testcase_list[next(iter(testcase_yaml.keys()))] = \ testcase else: cls.logger.error('Failed to create test case: {}' |