Fix bugs in `runner/benchmark` 05/25605/1
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Wed, 7 Dec 2016 08:25:18 +0000 (16:25 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Wed, 7 Dec 2016 08:25:18 +0000 (16:25 +0800)
- should inherit `object` for common methods
- should use instance class in abstract method

Change-Id: I78c08476da544402851e4b53e2d45c32a7f86722
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
qtip/runner/benchmark.py
tests/unit/runner/perftest_test.py
tests/unit/runner/suite_test.py
tests/unit/runner/testplan_test.py

index 56b5b30..58e5a8d 100644 (file)
@@ -18,7 +18,7 @@ class Property:
     ABSPATH = 'abspath'
 
 
-class Benchmark:
+class Benchmark(object):
     """Abstract class of QTIP benchmarks"""
 
     _paths = [path.join(path.dirname(__file__), path.pardir, path.pardir,
@@ -40,7 +40,7 @@ class Benchmark:
     def list_all(cls):
         """list all available benchmarks"""
         names = chain.from_iterable([listdir(p) for p in cls._paths])
-        return [Benchmark(name).describe() for name in names]
+        return [cls(name).describe() for name in names]
 
     def describe(self):
         """description of benchmark"""
index b3e6e8e..1f0b563 100644 (file)
@@ -39,3 +39,4 @@ class TestPerfTest:
             assert Property.NAME in desc
             assert Property.DESCRIPTION in desc
             assert Property.ABSPATH in desc
+            assert Property.ABSPATH is not None
index 5d2f106..1020580 100644 (file)
@@ -39,3 +39,4 @@ class TestSuite:
             assert Property.NAME in suite_desc
             assert Property.DESCRIPTION in suite_desc
             assert Property.ABSPATH in suite_desc
+            assert Property.ABSPATH is not None
index 2700d38..de8bf1e 100644 (file)
@@ -39,3 +39,4 @@ class TestTestPlan:
             assert Property.NAME in desc
             assert Property.DESCRIPTION in desc
             assert Property.ABSPATH in desc
+            assert Property.ABSPATH is not None