diff options
Diffstat (limited to 'functest/core')
-rw-r--r-- | functest/core/feature.py | 12 | ||||
-rw-r--r-- | functest/core/testcase.py | 23 |
2 files changed, 19 insertions, 16 deletions
diff --git a/functest/core/feature.py b/functest/core/feature.py index 00c7ec74..d8ddbdeb 100644 --- a/functest/core/feature.py +++ b/functest/core/feature.py @@ -25,7 +25,7 @@ __author__ = ("Serena Feng <feng.xiaowei@zte.com.cn>, " class Feature(base.TestCase): - """Parent class of Functest Feature.""" + """Base model for single Functest feature.""" def __init__(self, **kwargs): super(Feature, self).__init__(**kwargs) @@ -34,11 +34,13 @@ class Feature(base.TestCase): self.logger = ft_logger.Logger(self.project_name).getLogger() def execute(self, **kwargs): - """Execute Feature. + """Execute the Python method. The subclasses must override the default implementation which - is false on purpose. The only prerequisite is to return 0 if - success or anything else if failure. + is false on purpose. + + The new implementation must return 0 if success or anything + else if failure. Args: kwargs: Arbitrary keyword arguments. @@ -50,7 +52,7 @@ class Feature(base.TestCase): return -1 def run(self, **kwargs): - """Run Feature. + """Run the feature. It allows executing any Python method by calling execute(). diff --git a/functest/core/testcase.py b/functest/core/testcase.py index 472d847a..c306b143 100644 --- a/functest/core/testcase.py +++ b/functest/core/testcase.py @@ -18,19 +18,19 @@ __author__ = "Cedric Ollivier <cedric.ollivier@orange.com>" class TestCase(object): - """Parent class of Functest TestCase.""" + """Base model for single Functest testcase.""" EX_OK = os.EX_OK - """Status code returned when everything is OK""" + """everything is OK""" EX_RUN_ERROR = os.EX_SOFTWARE - """Status code returned when run() fails""" + """run() failed""" EX_PUSH_TO_DB_ERROR = os.EX_SOFTWARE - 1 - """Status code returned when push_to_db() fails""" + """push_to_db() failed""" EX_TESTCASE_FAILED = os.EX_SOFTWARE - 2 - """Status code returned when results are false""" + """results are false""" logger = ft_logger.Logger(__name__).getLogger() @@ -43,7 +43,7 @@ class TestCase(object): self.stop_time = "" def check_criteria(self): - """Interpret the results of TestCase. + """Interpret the results of the testcase. It allows getting the results of TestCase. It completes run() which only returns the execution status. @@ -63,16 +63,17 @@ class TestCase(object): return TestCase.EX_TESTCASE_FAILED def run(self, **kwargs): - """Run TestCase. + """Run the testcase. It allows running TestCase and getting its execution status. The subclasses must override the default implementation which - is false on purpose. The only prerequisite is to set the - following attributes to push the results to DB: + is false on purpose. + + The new implementation must set the following attributes to + push the results to DB: - * case_name, * criteria, * start_time, * stop_time. @@ -88,7 +89,7 @@ class TestCase(object): return TestCase.EX_RUN_ERROR def push_to_db(self): - """Push the results of TestCase to the DB. + """Push the results of the testcase to the DB. It allows publishing the results and to check the status. |