diff options
author | Linghui Zeng <linghui.zeng@huawei.com> | 2016-11-14 10:29:21 +0800 |
---|---|---|
committer | Linghui Zeng <linghui.zeng@huawei.com> | 2016-11-15 12:35:55 +0000 |
commit | b90fc8907f0c4ba716d6332159f881f880965277 (patch) | |
tree | ef45a29df64a4d401c796e6da6ede3c5f857af00 /dovetail/report.py | |
parent | 64b221bee631cf52bf6a1109c16f9544eff58f80 (diff) |
dovetail tool: replace the hard-coded "Tescase" and modify some classmethod
JIRA: DOVETAIL-45
1. In the testcase.py file, we replace the hard-coded "Tesecase" with "cls" or "self" based on
the specific contexts.
2. For all the four committed files, we modify some classmethod into staticmethod because each
method is basically just a function, called syntactically like a method, but without access
to the object and its' internals (attributes and other methods).
Change-Id: Ieb452f476a2d33ae9aca4c904ae7d2c92b68689e
Signed-off-by: Linghui Zeng <linghui.zeng@huawei.com>
Diffstat (limited to 'dovetail/report.py')
-rw-r--r-- | dovetail/report.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/dovetail/report.py b/dovetail/report.py index 127c191d..a828d4f3 100644 --- a/dovetail/report.py +++ b/dovetail/report.py @@ -30,8 +30,8 @@ class Report: results = {'functest': {}, 'yardstick': {}} - @classmethod - def check_result(cls, testcase, db_result): + @staticmethod + def check_result(testcase, db_result): checker = CheckerFactory.create(testcase.script_type()) checker.check(testcase, db_result) @@ -92,8 +92,8 @@ class Report: return rpt_text # save to disk as default - @classmethod - def save(cls, report): + @staticmethod + def save(report): report_file_name = dovetail_config['report_file'] try: with open(os.path.join(dovetail_config['result_dir'], @@ -127,8 +127,8 @@ class Report: class CrawlerFactory: - @classmethod - def create(cls, type): + @staticmethod + def create(type): if type == 'functest': return FunctestCrawler() @@ -234,8 +234,8 @@ class YardstickCrawler: class CheckerFactory: - @classmethod - def create(cls, type): + @staticmethod + def create(type): if type == 'functest': return FunctestChecker() @@ -247,13 +247,15 @@ class CheckerFactory: class ResultChecker: - def check(cls): + @staticmethod + def check(): return 'PASS' class FunctestChecker: - def check(cls, testcase, db_result): + @staticmethod + def check(testcase, db_result): sub_testcase_list = testcase.sub_testcase() if not db_result: @@ -286,7 +288,8 @@ class FunctestChecker: class YardstickChecker: - def check(cls, testcase, result): + @staticmethod + def check(testcase, result): if not result: testcase.passed(False) else: |